# HG changeset patch # User jwe # Date 847307768 0 # Node ID b8c53143581b28d3970f9d2d3feb334a87fe8ee3 # Parent bb0c213e58855a34ebdefa8c5df8fa561588e062 [project @ 1996-11-06 19:16:07 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +Wed Nov 6 12:32:48 1996 John W. Eaton + + * variables.cc (is_function_file): Call gobble_leading_whitespace + here to strip all leading whitespace and comments. + (parse_fcn_file): If reading a function file, call + gobble_leading_whitespace again after resetting parser state to + grab help text. + Tue Nov 5 13:00:35 1996 John W. Eaton * syscalls.cc (Fgeteuid, Fgetuid): New functions. diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -458,7 +458,7 @@ // code! static string -gobble_leading_white_space (FILE *ffile, int in_parts) +gobble_leading_white_space (FILE *ffile, bool in_parts) { string help_txt; @@ -560,6 +560,8 @@ long pos = ftell (ffile); + gobble_leading_white_space (ffile, false); + char buf [10]; fgets (buf, 10, ffile); int len = strlen (buf); @@ -609,8 +611,6 @@ // Check to see if this file defines a function or is just a // list of commands. - string tmp_help_txt = gobble_leading_white_space (ffile, 0); - if (is_function_file (ffile)) { // XXX FIXME XXX -- we shouldn't need both the @@ -642,7 +642,10 @@ reset_parser (); - help_buf = tmp_help_txt; + help_buf = gobble_leading_white_space (ffile, true); + + // XXX FIXME XXX -- this should not be necessary. + gobble_leading_white_space (ffile, false); int status = yyparse (); @@ -774,7 +777,7 @@ if (fptr) { - retval = gobble_leading_white_space (fptr, 1); + retval = gobble_leading_white_space (fptr, true); fclose (fptr); } }