diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-10 10:40:21 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-10 10:40:21 +0000 |
commit | f974f892c770d8da7cd1eec51ef85613d1f0b534 (patch) | |
tree | c249fe65c142640df327f8459514afc5a8ae581f /libgfortran | |
parent | d9498b79951d9cf919c429eb922df0a35195a2cd (diff) |
* intrinsics/strinf_intrinsics.c (compare_string): Return value based
on which string is longest.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@70289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/intrinsics/string_intrinsics.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 664fd754654..1caea5e9862 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,5 +1,10 @@ 2003-08-10 Paul Brook <paul@nowt.org> + * intrinsics/strinf_intrinsics.c (compare_string): Return value based + on which string is longest. + +2003-08-10 Paul Brook <paul@nowt.org> + * Makefile.am (EXTRA_DIST): Remove old files. * Makefile.in: Regenerate. diff --git a/libgfortran/intrinsics/string_intrinsics.c b/libgfortran/intrinsics/string_intrinsics.c index 134b612ed16..edab78035db 100644 --- a/libgfortran/intrinsics/string_intrinsics.c +++ b/libgfortran/intrinsics/string_intrinsics.c @@ -108,11 +108,13 @@ compare_string (G95_INTEGER_4 len1, const char * s1, { len = len2 - len1; s = &s2[len1]; + res = -1; } else { len = len1 - len2; s = &s1[len2]; + res = 1; } while (len--) @@ -120,9 +122,9 @@ compare_string (G95_INTEGER_4 len1, const char * s1, if (*s != ' ') { if (*s > ' ') - return 1; + return res; else - return -1; + return -res; } s++; } |