From 6f705051d3b5b7ae380d0e13ad6fb8f4568066d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosciuszkiewicz Date: Mon, 7 Mar 2011 01:01:38 +0100 Subject: [PATCH] gsch2pcb: fix check for filename ending with .sch --- utils/src/gsch2pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/src/gsch2pcb.c b/utils/src/gsch2pcb.c index 095d4008d..24b9e0639 100644 --- a/utils/src/gsch2pcb.c +++ b/utils/src/gsch2pcb.c @@ -1047,7 +1047,7 @@ add_schematic (gchar * sch) else schematics = g_strdup (sch); g_free (s); - if (!sch_basename && (s = strstr (sch, ".sch")) != NULL) + if (!sch_basename && (s = g_strrstr (sch, ".sch")) != NULL && strlen(s) == 4) sch_basename = g_strndup (sch, s - sch); } @@ -1291,7 +1291,7 @@ get_args (gint argc, gchar ** argv) printf ("gsch2pcb: bad or incomplete arg: %s\n", argv[i]); usage (); } else { - if ((s = strstr (argv[i], ".sch")) == NULL) { + if (!g_str_has_suffix (argv[i], ".sch")) { load_extra_project_files (); load_project (argv[i]); } else -- 2.11.4.GIT