pkgsrc/databases/palm-db-tools/patches/patch-ac

34 lines
915 B
Text

$NetBSD: patch-ac,v 1.3 2010/08/11 12:21:56 dsainty Exp $
Defining _XOPEN_SOURCE breaks the build under NetBSD.
The default C++ precision of 6 digits is Very risky in a database context.
As with DATE fields, if a TIME field is unset (hour value 24+), output an
empty string.
--- libsupport/csvfile.cpp.orig 2003-06-20 11:37:47.000000000 +1200
+++ libsupport/csvfile.cpp 2010-08-09 22:30:58.306485980 +1200
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE
+#include <string.h>
#include <iostream>
#include <fstream>
@@ -299,6 +299,7 @@
break;
case PalmLib::FlatFile::Field::FLOAT:
+ fldstr.precision(12);
fldstr << field.v_float;
break;
@@ -329,7 +330,7 @@
break;
case PalmLib::FlatFile::Field::TIME:
- {
+ if (field.v_time.hour <= 23) {
char buf[1024];
struct tm tm;
const struct tm * tm_ptr;