Skip to content

Commit

Permalink
Allow file=- for stdin
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60522 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
glynnc committed May 27, 2014
1 parent f92ea5c commit 606c95b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions raster/r.series/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,14 @@ int main(int argc, char *argv[])
if (parm.file->answer) {
FILE *in;
int max_inputs;

in = fopen(parm.file->answer, "r");
if (!in)
G_fatal_error(_("Unable to open input file <%s>"), parm.file->answer);

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);
}

num_inputs = 0;
max_inputs = 0;
Expand Down

0 comments on commit 606c95b

Please sign in to comment.