diff options
-rw-r--r-- | src/ChangeLog | 1 | ||||
-rw-r--r-- | src/process.c | 20 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b877ebc..c2e356f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -107,6 +107,7 @@ Version 4.1.0 (??/??/20??): * Romain Francoise <romain@orebokech.com> * Emanuele Giaquinta <e.giaquinta@glauco.it> * Yi-Hsuan Hsin <mhsin@mhsin.org> + * Kipling Inscore <kinscore@synaptics.com> * Chris Jones <cjns1989@gmail.com> * Max Kalashnikov <mmt@maxkalashnikov.com> * Steve Kemp <steve@steve.org.uk> diff --git a/src/process.c b/src/process.c index cc2b56f..783fdd7 100644 --- a/src/process.c +++ b/src/process.c @@ -1271,14 +1271,22 @@ int key; case RC_HARDCOPY: { int mode = DUMP_HARDCOPY; + char *file = NULL; - if (argc > 1 && !strcmp(*args, "-h")) + if (args[0]) { - mode = DUMP_SCROLLBACK; - args++; - argc--; + if (!strcmp(*args, "-h")) + { + mode = DUMP_SCROLLBACK; + file = args[1]; + } + else if (!strcmp(*args, "--") && args[1]) + file = args[1]; + else + file = args[0]; } - if (*args && args[1]) + + if (args[0] && file == args[0] && args[1]) { OutputMsg(0, "%s: hardcopy: too many arguments", rc_name); break; @@ -1286,7 +1294,7 @@ int key; if (fore == 0 && *args == 0) OutputMsg(0, "%s: hardcopy: window required", rc_name); else - WriteFile(user, *args, mode); + WriteFile(user, file, mode); } break; case RC_DEFLOG: |