[GRASS-dev] G_getl2() with stdin?

Hamish hamish_nospam at yahoo.com
Wed May 16 04:30:37 EDT 2007


what's the point of using G_getl2() with stdin?

are we about to see a new file= option for r.reclass input? :)


Hamish

===================================================================
RCS file: /home/grass/grassrepository/grass6/raster/r.reclass/input.c,v
retrieving revision 2.1
retrieving revision 2.1.4.1
diff -u -r2.1 -r2.1.4.1
--- grass6/raster/r.reclass/input.c	2005/07/13 15:52:54	2.1
+++ grass6/raster/r.reclass/input.c	2007/05/16 07:14:32	2.1.4.1
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
+#include <grass/gis.h>
 
 int 
 input (char *buf)
@@ -8,7 +9,7 @@
     char temp1[10], temp2[2];
     if (isatty(0))
 	fprintf (stdout,"> ");
-    if(!fgets(buf,1024,stdin))
+    if(!G_getl2 (buf, 1024, stdin))
 	return 0;
     if (sscanf (buf, "%5s%1s",temp1,temp2)==1 &&
         strcmp (temp1,"end")==0) return 0;




More information about the grass-dev mailing list