[GRASS-SVN] r60523 - grass/branches/releasebranch_7_0/raster/r.series

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 27 16:19:56 PDT 2014


Author: neteler
Date: 2014-05-27 16:19:56 -0700 (Tue, 27 May 2014)
New Revision: 60523

Modified:
   grass/branches/releasebranch_7_0/raster/r.series/main.c
Log:
r.series: allow file=- for stdin (backport from trunk, r60522)

Modified: grass/branches/releasebranch_7_0/raster/r.series/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.series/main.c	2014-05-27 23:06:36 UTC (rev 60522)
+++ grass/branches/releasebranch_7_0/raster/r.series/main.c	2014-05-27 23:19:56 UTC (rev 60523)
@@ -205,11 +205,15 @@
     if (parm.file->answer) {
 	FILE *in;
 	int max_inputs;
+
+	if (strcmp(parm.file->answer, "-") == 0)
+	    in = stdin;
+	else {
+	    in = fopen(parm.file->answer, "r");
+	    if (!in)
+		G_fatal_error(_("Unable to open input file <%s>"), parm.file->answer);
+	}
     
-	in = fopen(parm.file->answer, "r");
-	if (!in)
-	    G_fatal_error(_("Unable to open input file <%s>"), parm.file->answer);
-    
 	num_inputs = 0;
 	max_inputs = 0;
 



More information about the grass-commit mailing list