From 214aca697c8423be1f88948c09bc7e25b8e8d7f8 Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Fri, 2 Nov 2012 01:26:30 +0800 Subject: [PATCH] Fix fparseln flags to remove escape characters in the result. For example, \# should result in #. Add note in manpage that # must be escaped when not used in an option. --- spectrwm.1 | 6 ++++++ spectrwm.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spectrwm.1 b/spectrwm.1 index 38c208e..b90227b 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -82,6 +82,9 @@ Colors need to be specified per the .Xr XQueryColor 3 specification. .Pp +Comments begin with a #. When a literal '#' is desired in an option, then it +must be escaped with a backslash. i.e. \e# +.Pp The file supports the following keywords: .Bl -tag -width 2m .It Ic autorun @@ -427,6 +430,9 @@ is the desired program, and .Aq arg is zero or more arguments to the program. .Pp +Remember that when using # in your program call, it must be escaped with a +backslash. i.e. \e# +.Pp The following argument variables will be substituted for values at the time the program is spawned: .Pp diff --git a/spectrwm.c b/spectrwm.c index 16cb8b3..4530bd7 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -7246,8 +7246,8 @@ conf_load(const char *filename, int keymapping) if (line) free(line); - if ((line = fparseln(config, &linelen, &lineno, NULL, 0)) - == NULL) { + if ((line = fparseln(config, &linelen, &lineno, NULL, + FPARSELN_UNESCCOMM | FPARSELN_UNESCCONT)) == NULL) { if (ferror(config)) err(1, "%s", filename); else -- 1.7.10.4