=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/Attic/datafile.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.2 diff -u -p -r1.1.1.1 -r1.1.1.2 --- OpenXM_contrib/gnuplot/Attic/datafile.c 2000/01/09 17:00:50 1.1.1.1 +++ OpenXM_contrib/gnuplot/Attic/datafile.c 2000/01/22 14:15:57 1.1.1.2 @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid = "$Id: datafile.c,v 1.1.1.1 2000/01/09 17:00:50 maekawa Exp $"; +static char *RCSid = "$Id: datafile.c,v 1.1.1.2 2000/01/22 14:15:57 maekawa Exp $"; #endif /* GNUPLOT - datafile.c */ @@ -348,12 +348,15 @@ char *s; #endif /* NO_FORTRAN_NUMS */ } else { /* skip any space at start of column */ - while (isspace((int)*s)) + /* HBB tells me that the cast must be to + * unsigned char instead of int. */ + while (isspace((unsigned char) *s)) ++s; count = *s ? 1 : 0; /* skip chars to end of column */ - for (used = 0; !isspace((int)*s) && (*s != NUL); ++used, ++s) - ; + used = 0; + while (!isspace((unsigned char) *s) && (*s != NUL)) + ++s; } /* it might be a fortran double or quad precision. @@ -467,7 +470,8 @@ int max_using; */ { - static char filename[MAX_LINE_LEN + 1] = ""; + /* now allocated dynamically */ + static char *filename = NULL; int i; int name_token; @@ -516,14 +520,12 @@ int max_using; assert(max_using <= NCOL); /* empty name means re-use last one */ - - { - char name[MAX_LINE_LEN + 1]; - quote_str(name, c_token, MAX_LINE_LEN); - if (name[0]) - strcpy(filename, name); - else if (!filename[0]) - int_error("No previous filename", c_token); + if (isstring(c_token) && token_len(c_token) == 2) { + if (!filename || !*filename) + int_error("No previous filename",c_token); + } else { + filename = gp_realloc(filename, token_len(c_token), "datafile name"); + quote_str(filename, c_token, token_len(c_token)); } name_token = c_token++;