aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koenig <Thomas.Koenig@online.de>2005-04-09 19:37:14 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2005-04-09 19:37:14 +0000
commit130bcb37be10302019e694667caa3522f5f5f327 (patch)
tree94d9b9e22e20e27d119330c05f61b8a0693823fa
parentbbaa6cf677bb7de02486fadba75cff8fd3972a29 (diff)
downloadgcc-130bcb37be10302019e694667caa3522f5f5f327.zip
gcc-130bcb37be10302019e694667caa3522f5f5f327.tar.gz
gcc-130bcb37be10302019e694667caa3522f5f5f327.tar.bz2
re PR libfortran/20163 ([4.0 only] gfortran - error opening direct access file)
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. From-SVN: r97923
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/runtime/string.c14
2 files changed, 10 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 9399d73..2f31127 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2005-04-09 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/13257
diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c
index 07ed99b..07f374e 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;
}