Mercurial > hg > octave-lyh
comparison 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 |
comparison
equal
deleted
inserted
replaced
1033:ad8d79f99b28 | 1034:69e610fb0013 |
---|---|
732 } | 732 } |
733 | 733 |
734 static int | 734 static int |
735 match_sans_spaces (const char *standard, const char *test) | 735 match_sans_spaces (const char *standard, const char *test) |
736 { | 736 { |
737 const char *tp = test; | 737 char *tmp = strsave (test); |
738 | |
739 char *tp = tmp; | |
738 while (*tp == ' ' || *tp == '\t') | 740 while (*tp == ' ' || *tp == '\t') |
739 tp++; | 741 tp++; |
740 | 742 |
741 const char *ep = test + strlen (test) - 1; | 743 char *ep = test + strlen (test) - 1; |
742 while (*ep == ' ' || *ep == '\t') | 744 while (*ep == ' ' || *ep == '\t') |
743 ep--; | 745 ep--; |
744 | 746 |
745 int len = ep - tp + 1; | 747 *(ep+1) = '\0'; |
746 | 748 |
747 return (strncmp (standard, tp, len) == 0); | 749 int retval = strcmp (standard, tp) == 0; |
750 | |
751 delete [] tmp; | |
752 | |
753 return retval; | |
754 | |
748 } | 755 } |
749 | 756 |
750 // If the user simply hits return, this will produce an empty matrix. | 757 // If the user simply hits return, this will produce an empty matrix. |
751 | 758 |
752 static Octave_object | 759 static Octave_object |