Fix imake segfault on OpenIndiana

Version string changed in distributed GCC6, confusing
get_sun_compiler_versions().
This commit is contained in:
Matthew R. Trower 2018-06-04 00:34:52 -05:00 committed by Jon Trulson
parent fd9e74ae42
commit 650ce0768f
1 changed files with 2 additions and 2 deletions

View File

@ -1157,7 +1157,7 @@ get_sun_compiler_versions(FILE *inFile)
strncat (cmd, " --version 2>&1", 15);
if ((ccproc = popen (cmd, "r")) != NULL) {
if (fgets (buf, PATH_MAX, ccproc) != NULL) {
vptr = strrchr (buf, 'G');
vptr = strrchr (buf, ')');
for (; !isdigit(*vptr); vptr++);
ret = sscanf (vptr, "%d.%d", &cmajor, &cminor);
fprintf (inFile,
@ -1182,7 +1182,7 @@ get_sun_compiler_versions(FILE *inFile)
strncat (cmd, " --version 2>&1", 15);
if ((ccproc = popen (cmd, "r")) != NULL) {
if (fgets (buf, PATH_MAX, ccproc) != NULL) {
vptr = strrchr (buf, 'G');
vptr = strrchr (buf, ')');
for (; !isdigit(*vptr); vptr++);
ret = sscanf (vptr, "%d.%d", &cmajor, &cminor);
fprintf (inFile,