summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Naumov <alexander_naumov@opensuse.org>2016-09-22 17:08:24 +0200
committerAlexander Naumov <alexander_naumov@opensuse.org>2016-09-22 17:08:24 +0200
commitcc54563ea8f669156e7dd052bce0917e550e2018 (patch)
treebb6473d4bee1870232a31d6c412e641426dafe99
parentf3a12f015766becab73d88c5d5c4720c86e14987 (diff)
downloadscreen-cc54563ea8f669156e7dd052bce0917e550e2018.tar.gz
Allow specifying logfile's name via command line parameter
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
-rw-r--r--src/ChangeLog3
-rw-r--r--src/doc/screen.16
-rw-r--r--src/screen.c7
3 files changed, 14 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 098a730..c0e6e86 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,6 @@
+Version 4.5.0 ():
+ * Allow specifying logfile's name via command line parameter
+
Version 4.4.0 (19/06/2016):
* Support up to 24 function keys
* Fix runtime issues
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index 629ccfd..442f084 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -1,5 +1,5 @@
.\" vi:set wm=5
-.TH SCREEN 1 "May 2015"
+.TH SCREEN 1 "Sep 2016"
.if n .ds Q \&"
.if n .ds U \&"
.if t .ds Q ``
@@ -261,7 +261,9 @@ Ask your system administrator if you are not sure. Remove sessions with the
.B \-L
tells
.I screen
-to turn on automatic output logging for the windows.
+to turn on automatic output logging for the windows. By default, logfile's name
+is screenlog.1. You can sets new name: add it right after -L option e.g. "screen
+-L my_logfile".
.TP 5
.B \-m
causes
diff --git a/src/screen.c b/src/screen.c
index a2a1681..d73ca8f 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -679,6 +679,13 @@ char **av;
}
break;
case 'L':
+ if (--ac != 0) {
+ screenlogfile = SaveStr(*++av);
+ if (screenlogfile[0] == '-')
+ Panic(0, "-L: logfile name can not start with \"-\" symbol");
+ if (strlen(screenlogfile) > PATH_MAX)
+ Panic(0, "-L: logfile name too long. (max. %d char)", PATH_MAX);
+ }
nwin_options.Lflag = 1;
break;
case 'm':