Browse Source

G_open_option_file(): more useful error message

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60518 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 11 years ago
parent
commit
f498900f3e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lib/gis/parser.c

+ 4 - 2
lib/gis/parser.c

@@ -1512,12 +1512,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"));