summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1997-07-13 16:21:56 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>1997-07-13 16:21:56 +0000
commite3ccb76d78446f0db5faea76b6f32f01bb08a5ae (patch)
tree74a13dd02c628b95460aacf04857027cb25ad7aa /gcc
parent32612dd342f904fcbe1028abdc07a553c6bc4fb5 (diff)
downloadgcc-e3ccb76d78446f0db5faea76b6f32f01bb08a5ae.tar.gz
* gcc.c (main): Handle blank in version_string when comparing
with compiler_version. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14414 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 33b220a22c0..c844f08bc99 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4533,7 +4533,17 @@ main (argc, argv)
if (verbose_flag)
{
- if (! strcmp (version_string, compiler_version))
+ int n;
+
+ /* compiler_version is truncated at the first space when initialized
+ from version string, so truncate version_string at the first space
+ before comparing. */
+ for (n = 0; version_string[n]; n++)
+ if (version_string[n] == ' ')
+ break;
+
+ if (! strncmp (version_string, compiler_version, n)
+ && compiler_version[n] == 0)
fprintf (stderr, "gcc version %s\n", version_string);
else
fprintf (stderr, "gcc driver version %s executing gcc version %s\n",