changeset 1034:69e610fb0013

[project @ 1995-01-15 22:31:39 by jwe]
author jwe
date Sun, 15 Jan 1995 22:31:39 +0000
parents ad8d79f99b28
children 482d40c91fea
files src/input.cc
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/input.cc	Sun Jan 15 21:48:53 1995 +0000
+++ b/src/input.cc	Sun Jan 15 22:31:39 1995 +0000
@@ -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.