Sfoglia il codice sorgente

hcho: G_open_option_file(): more useful error message
(merge https://trac.osgeo.org/grass/changeset/60518 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@60741 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 11 anni fa
parent
commit
b0d2c515bd
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      lib/gis/parser.c

+ 4 - 2
lib/gis/parser.c

@@ -1514,12 +1514,14 @@ FILE *G_open_option_file(const struct Option *option)
 	if (stdinout)
 	    fp = stdin;
 	else if ((fp = fopen(option->answer, "r")) == NULL)
-	    G_fatal_error(_("Unable to read file [%s]"), option->answer);
+	    G_fatal_error(_("Unable to read %s file <%s>"),
+			    option->key, option->answer);
     } else if (strcmp(option->gisprompt, "new,file,file") == 0) {
 	if (stdinout)
 	    fp = stdout;
 	else if ((fp = fopen(option->answer, "w")) == NULL)
-	    G_fatal_error(_("Unable to create file [%s]"), option->answer);
+	    G_fatal_error(_("Unable to create %s file <%s>"),
+			    option->key, option->answer);
     } else
         G_fatal_error(_("Not a file option"));