Mercurial > hg > octave-lyh
diff src/input.cc @ 1034:69e610fb0013
[project @ 1995-01-15 22:31:39 by jwe]
author | jwe |
---|---|
date | Sun, 15 Jan 1995 22:31:39 +0000 |
parents | dfe01093f657 |
children | 1aa6f2edd975 |
line wrap: on
line diff
--- a/src/input.cc +++ b/src/input.cc @@ -734,17 +734,24 @@ static int match_sans_spaces (const char *standard, const char *test) { - const char *tp = test; + char *tmp = strsave (test); + + char *tp = tmp; while (*tp == ' ' || *tp == '\t') tp++; - const char *ep = test + strlen (test) - 1; + char *ep = test + strlen (test) - 1; while (*ep == ' ' || *ep == '\t') ep--; - int len = ep - tp + 1; + *(ep+1) = '\0'; + + int retval = strcmp (standard, tp) == 0; - return (strncmp (standard, tp, len) == 0); + delete [] tmp; + + return retval; + } // If the user simply hits return, this will produce an empty matrix.