]> granicus.if.org Git - postgresql/commitdiff
Fix parsing of compatibility mode argument.
authorMichael Meskes <meskes@postgresql.org>
Fri, 12 Jan 2018 14:59:43 +0000 (15:59 +0100)
committerMichael Meskes <meskes@postgresql.org>
Fri, 12 Jan 2018 15:00:43 +0000 (16:00 +0100)
Patch by Ashutosh Sharma <ashu.coek88@gmail.com>

src/interfaces/ecpg/preproc/ecpg.c

index 8a1457226124c342c7a76e3827c2f48e531d6b8c..cd770c8b1569531fcceddd204484632f8d57e780 100644 (file)
@@ -198,12 +198,12 @@ main(int argc, char *const argv[])
                                system_includes = true;
                                break;
                        case 'C':
-                               if (strncmp(optarg, "INFORMIX", strlen("INFORMIX")) == 0)
+                               if (pg_strcasecmp(optarg, "INFORMIX") == 0 || pg_strcasecmp(optarg, "INFORMIX_SE") == 0)
                                {
                                        char            pkginclude_path[MAXPGPATH];
                                        char            informix_path[MAXPGPATH];
 
-                                       compat = (strcmp(optarg, "INFORMIX") == 0) ? ECPG_COMPAT_INFORMIX : ECPG_COMPAT_INFORMIX_SE;
+                                       compat = (pg_strcasecmp(optarg, "INFORMIX") == 0) ? ECPG_COMPAT_INFORMIX : ECPG_COMPAT_INFORMIX_SE;
                                        get_pkginclude_path(my_exec_path, pkginclude_path);
                                        snprintf(informix_path, MAXPGPATH, "%s/informix/esql", pkginclude_path);
                                        add_include_path(informix_path);