From ccb035ab284dcce968d948a5f04eef96c9cc541d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 24 Oct 2009 09:08:26 +0000 Subject: Enable Halibut to read a .but file from standard input, by supplying the special filename '-'. [originally from svn r8728] --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 60ad74f..dae6581 100644 --- a/main.c +++ b/main.c @@ -85,7 +85,7 @@ int main(int argc, char **argv) { */ while (--argc) { char *p = *++argv; - if (*p == '-') { + if (*p == '-' && p[1]) { /* * An option. */ @@ -264,7 +264,10 @@ int main(int argc, char **argv) { /* * A non-option argument. */ - infiles[nfiles++] = p; + if (!strcmp(p, "-")) + infiles[nfiles++] = NULL; /* special case: read stdin */ + else + infiles[nfiles++] = p; } } -- cgit v1.1