Mercurial > hg > octave-terminal
changeset 312:069ae2896cf7
[project @ 1994-01-19 21:40:41 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jan 1994 21:40:54 +0000 |
parents | c6e054496783 |
children | 9465b39f764a |
files | src/pt-const.cc src/t-builtins.cc src/variables.cc |
diffstat | 3 files changed, 11 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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++; }
--- 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))