aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index e1b3324..2cf5bcb 100644
--- a/main.c
+++ b/main.c
@@ -37,12 +37,18 @@ main(int argc, char *argv[])
targinit(target);
- if (argc > 1)
- usage();
if (output && !freopen(output, "w", stdout))
fatal("open %s:", output);
- ppinit(argv[0]);
+ if (argc) {
+ while (argc--)
+ scanfrom(argv[argc], NULL);
+ scanopen();
+ } else {
+ scanfrom("<stdin>", stdin);
+ }
+
+ ppinit();
if (pponly) {
while (tok.kind != TEOF) {
tokprint(&tok);