Mercurial > hg > octave-lojdl
changeset 918:1ba7f3818e4b
[project @ 1994-11-11 20:17:27 by jwe]
author | jwe |
---|---|
date | Fri, 11 Nov 1994 20:17:27 +0000 |
parents | b843a65fa977 |
children | ba98491f97b2 |
files | src/load-save.cc |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -1055,7 +1055,7 @@ // // Input should look something like: // -// #[ \t]*keyword[ \t]*:[ \t]*string-value\n +// #[ \t]*keyword[ \t]*:[ \t]*string-value[ \t]*\n static char * extract_keyword (istream& is, char *keyword) @@ -1101,6 +1101,19 @@ } } } + + if (retval) + { + int len = strlen (retval); + if (len > 0) + { + char *ptr = retval + len - 1; + while (*ptr == ' ' || *ptr == '\t') + ptr--; + *(ptr+1) = '\0'; + } + } + return retval; } @@ -1109,7 +1122,7 @@ // // Input should look something like: // -// [ \t]*keyword[ \t]*int-value\n +// [ \t]*keyword[ \t]*int-value.*\n static int extract_keyword (istream& is, char *keyword, int& value)