Changeset: aeb16cdb3ed7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aeb16cdb3ed7
Modified Files:
clients/mapiclient/mclient.c
Branch: Aug2011
Log Message:
mclient: Read in blocks that are independent of the value of BUFSIZ.
This will make that error message have a bigger chance of being equal
on different system.
diffs (30 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1720,6 +1720,8 @@ showCommands(void)
enum hmyesno { UNKNOWN, YES, NO };
+#define READBLOCK 8192
+
static int
doFileByLines(Mapi mid, FILE *fp, const char *prompt, const char useinserts)
{
@@ -1734,7 +1736,7 @@ doFileByLines(Mapi mid, FILE *fp, const
#ifdef HAVE_LIBREADLINE
if (prompt == NULL)
#endif
- oldbuf = buf = malloc(BUFSIZ);
+ oldbuf = buf = malloc(READBLOCK);
do {
if (prompt) {
@@ -1781,7 +1783,7 @@ doFileByLines(Mapi mid, FILE *fp, const
free(buf);
buf = oldbuf;
line = buf;
- while (line < buf + BUFSIZ - 1 &&
+ while (line < buf + READBLOCK - 1 &&
(c = getc(fp)) != EOF) {
if (c == 0) {
fprintf(stderr, "NULL byte in input on
line %d of input\n", lineno);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list