[GRASS-SVN] r48026 - grass/trunk/vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 1 07:53:25 EDT 2011


Author: martinl
Date: 2011-09-01 04:53:25 -0700 (Thu, 01 Sep 2011)
New Revision: 48026

Modified:
   grass/trunk/vector/v.edit/main.c
Log:
v.edit: fix segfault when no input is defined


Modified: grass/trunk/vector/v.edit/main.c
===================================================================
--- grass/trunk/vector/v.edit/main.c	2011-09-01 11:39:52 UTC (rev 48025)
+++ grass/trunk/vector/v.edit/main.c	2011-09-01 11:53:25 UTC (rev 48026)
@@ -69,18 +69,18 @@
     }
 
     /* open input file */
-    if (strcmp(params.in->answer, "-") == 0 ||
-	(action_mode != MODE_CREATE && params.in->answer == NULL)) {
-	ascii = stdin;
-    }
-    else if (params.in->answer) {
+    if (params.in->answer &&
+	strcmp(params.in->answer, "-") != 0) {
 	ascii = fopen(params.in->answer, "r");
 	if (ascii == NULL) {
-	    G_fatal_error(_("Unable to open ASCII file <%s>"),
+	    G_fatal_error(_("Unable to open file <%s>"),
 			  params.in->answer);
 	}
     }
-
+    else if (action_mode != MODE_CREATE) {
+	ascii = stdin;
+    }
+    
     if (action_mode == MODE_CREATE) {
 	int overwrite;
 



More information about the grass-commit mailing list