aboutsummaryrefslogtreecommitdiff
path: root/src/facetron.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-09-14 09:42:45 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:57 +0100
commitc1fe0c1cf3468fc88e683f766a21e50583b5600f (patch)
tree1d1c72cc58e7e1682b96ea29035234ddf08648ac /src/facetron.c
parent4a235243ee6838b2745d9b3e8999d29fa76c394a (diff)
facetron: Can't handle stdin
Diffstat (limited to 'src/facetron.c')
-rw-r--r--src/facetron.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/facetron.c b/src/facetron.c
index c7c22e30..722f8195 100644
--- a/src/facetron.c
+++ b/src/facetron.c
@@ -37,8 +37,8 @@ static void show_help(const char *s)
"\n"
" -h, --help Display this help message.\n"
"\n"
-" -i, --input=<filename> Specify the name of the input stream.\n"
-" Can be '-' for stdin.\n"
+" -i, --input=<filename> Specify the name of the input 'stream'.\n"
+" (must be a file, not e.g. stdin)\n"
" -g. --geometry=<file> Get detector geometry from file.\n"
" -x, --prefix=<p> Prefix filenames from input file with <p>.\n"
" --basename Remove the directory parts of the filenames.\n"
@@ -195,16 +195,12 @@ int main(int argc, char *argv[])
}
if ( infile == NULL ) infile = strdup("-");
- if ( strcmp(infile, "-") == 0 ) {
- fh = stdin;
- } else {
- fh = fopen(infile, "r");
- }
- free(infile);
+ fh = fopen(infile, "r");
if ( fh == NULL ) {
ERROR("Couldn't open input stream '%s'\n", infile);
return ENOENT;
}
+ free(infile);
if ( prefix == NULL ) {
prefix = strdup("");