# HG changeset patch # User jwe # Date 759015654 0 # Node ID 069ae2896cf74669ba435ee61fb6b0329d1c49f3 # Parent c6e0544967831e4e1ab684ce89d78f299b9b5774 [project @ 1994-01-19 21:40:41 by jwe] diff --git a/src/pt-const.cc b/src/pt-const.cc --- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -1433,6 +1433,8 @@ else ::error ("failed to extract keyword specifying value type"); + delete [] tag; + return is_global; } diff --git a/src/t-builtins.cc b/src/t-builtins.cc --- a/src/t-builtins.cc +++ b/src/t-builtins.cc @@ -735,10 +735,12 @@ } int count = 0; + char *nm = (char *) NULL; for (;;) { // Read name for this entry or break on EOF. - char *nm = extract_keyword (stream, "name"); + delete [] nm; + nm = extract_keyword (stream, "name"); if (nm == (char *) NULL) { if (count == 0) @@ -932,7 +934,9 @@ for (i = 0; i < count; i++) { if (fnmatch (*argv, lvars[i], __FNM_FLAGS) == 0 - && curr_sym_tab->save (stream, lvars[i], 0, prec) != 0) + && curr_sym_tab->save (stream, lvars[i], + is_globally_visible (lvars[i]), + prec) != 0) saved_or_error++; } diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -449,18 +449,15 @@ * * #[ \t]*keyword[ \t]*:[ \t]*string-value\n * - * Returns a pointer to a static variable which is only valid until - * the next time this function is called. + * Returns a pointer to new storage. The caller is responsible for + * deleting it. */ char * extract_keyword (istream& is, char *keyword) { ostrstream buf; - static char *retval = (char *) NULL; - - delete [] retval; - retval = (char *) NULL; + char *retval = (char *) NULL; char c; while (is.get (c))