]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
remove -printf option from find; remove the misplaced 'local's
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 33bde557176bf0d3a5c6ab9a4077551334f37606..9a76706b06653412f017945dde44aa891ccdc06e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -234,6 +234,10 @@ static bool options_parse(int argc, char **argv) {
                 OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = (uint16_t)strtol(memdumpcols, NULL, 10);
                 continue;
             }
+            if (options_long_gcc("progsrc", &argc, &argv, &argarg)) {
+                OPTS_OPTION_STR(OPTION_PROGSRC) = argarg;
+                continue;
+            }
 
             /* show defaults (like pathscale) */
             if (!strcmp(argv[0]+1, "show-defaults")) {
@@ -670,9 +674,9 @@ int main(int argc, char **argv) {
 
         progs_src = true;
 
-        src = fs_file_open("progs.src", "rb");
+        src = fs_file_open(OPTS_OPTION_STR(OPTION_PROGSRC), "rb");
         if (!src) {
-            con_err("failed to open `progs.src` for reading\n");
+            con_err("failed to open `%s` for reading\n", OPTS_OPTION_STR(OPTION_PROGSRC));
             retval = 1;
             goto cleanup;
         }
@@ -786,5 +790,7 @@ cleanup:
     lex_cleanup();
     stat_info();
 
+    if (!retval && compile_errors)
+        retval = 1;
     return retval;
 }