summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-04-01 15:59:34 -0400
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-04-01 15:59:34 -0400
commit43db71f8b5ecb9e6f243cf940d479547ebf8c855 (patch)
tree21b27a4479fd0b32dd15c1a42b64be931c67d753
parentfd8832ccdbf807fe9a6ecd04d6166191c3b7ae90 (diff)
downloadscreen-43db71f8b5ecb9e6f243cf940d479547ebf8c855.tar.gz
Use NEED_FORE flag for 'hardcopy'.
Screen wouldn't do anything with 'hardcopy' if there was no foreground window, except overwriting the specified file (when hardcopy_append is off, of course). But the NEED_FORE flag wasn't set. I am not sure why this was the case. So I have added the NEED_FORE flag so that 'hardcopy' command fails if there is no foreground window.
-rw-r--r--src/comm.c2
-rw-r--r--src/process.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/comm.c b/src/comm.c
index aa512de..5f4af8a 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -195,7 +195,7 @@ struct comm comms[RC_LAST + 1] =
{ "focusminsize", ARGS_02 },
{ "gr", NEED_FORE|ARGS_01 },
{ "group", NEED_FORE|ARGS_01 },
- { "hardcopy", ARGS_012 },
+ { "hardcopy", NEED_FORE|ARGS_012 },
{ "hardcopy_append", ARGS_1 },
{ "hardcopydir", ARGS_01 },
{ "hardstatus", ARGS_012 },
diff --git a/src/process.c b/src/process.c
index 783fdd7..da9188d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1291,10 +1291,7 @@ int key;
OutputMsg(0, "%s: hardcopy: too many arguments", rc_name);
break;
}
- if (fore == 0 && *args == 0)
- OutputMsg(0, "%s: hardcopy: window required", rc_name);
- else
- WriteFile(user, file, mode);
+ WriteFile(user, file, mode);
}
break;
case RC_DEFLOG: