Jelajahi Sumber

r.in.xyz: close the input file when it should be closed (variable was not set, so behavior was random)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59431 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 tahun lalu
induk
melakukan
bc4cca91cd
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 2 0
      raster/r.in.xyz/main.c

+ 2 - 0
raster/r.in.xyz/main.c

@@ -535,6 +535,7 @@ int main(int argc, char *argv[])
 	infile = G_store("stdin");	/* filename for history metadata */
     }
     else {
+	from_stdin = FALSE;
 	if ((in_fp = fopen(infile, "r")) == NULL)
 	    G_fatal_error(_("Unable to open input file <%s>"), infile);
     }
@@ -560,6 +561,7 @@ int main(int argc, char *argv[])
 	scan_bounds(in_fp, xcol, ycol, zcol, vcol, fs, shell_style->answer,
 		    skipline->answer, zscale, vscale);
 
+	/* close input file */
 	if (!from_stdin)
 	    fclose(in_fp);