summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-09 19:37:14 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-09 19:37:14 +0000
commita7041de96eb2011e5bbb501e33c2e867f4c639ef (patch)
tree94d9b9e22e20e27d119330c05f61b8a0693823fa /libgfortran/runtime
parent3417c857d8af7c48e4c5eda7357a7bc0fcef63a2 (diff)
downloadgcc-a7041de96eb2011e5bbb501e33c2e867f4c639ef.tar.gz
2005-04-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/20163 * runtime/string.c (compare0): Use fstrlen() to strip trailing blanks from option string. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97923 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/string.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c
index 07ed99bab36..07f374eea04 100644
--- a/libgfortran/runtime/string.c
+++ b/libgfortran/runtime/string.c
@@ -41,17 +41,11 @@ static int
compare0 (const char *s1, int s1_len, const char *s2)
{
int i;
+ int len;
- if (strncasecmp (s1, s2, s1_len) != 0)
- return 0;
-
- /* The rest of s1 needs to be blanks for equality. */
-
- for (i = strlen (s2); i < s1_len; i++)
- if (s1[i] != ' ')
- return 0;
-
- return 1;
+ /* Strip trailing blanks from the Fortran string. */
+ len = fstrlen(s1, s1_len);
+ return strncasecmp(s1,s2,len) == 0;
}