diff --git a/bti-030-comment_marker.patch b/bti-030-comment_marker.patch new file mode 100644 index 0000000..513d255 --- /dev/null +++ b/bti-030-comment_marker.patch @@ -0,0 +1,34 @@ +From 211d649369fc07393a27542bf87a80d6211cb1a3 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Fri, 18 Mar 2011 20:44:00 +0100 +Subject: [PATCH] Only treat # as a comment marker if it's at the beginning of line or is + preceded by a whitespace character + +--- + config.c | 10 ++++++++-- + 1 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/config.c b/config.c +index 346fed8..9326c71 100644 +--- a/config.c ++++ b/config.c +@@ -344,8 +344,14 @@ void bti_parse_configfile(struct session *session) + if (line[n - 1] == '\n') + line[n - 1] = '\0'; + +- /* '#' is comment markers, like bash style */ +- *strchrnul(line, '#') = '\0'; ++ /* '#' is comment markers, like bash style ++ but it is a valid character in some fields, so ++ only treat it as a comment marker if it occurs ++ at the beginning of the line, or after whitespace */ ++ char *hashmarker = strchrnul(line, '#'); ++ if (line == hashmarker) line[0] = '\0'; ++ if (*(--hashmarker) == ' ' || *hashmarker == '\t') ++ *hashmarker = '\0'; + c = line; + while (isspace(*c)) + c++; +-- +1.7.4.1 + diff --git a/bti.spec b/bti.spec index f435374..7d2db67 100644 --- a/bti.spec +++ b/bti.spec @@ -1,6 +1,6 @@ Name: bti Version: 030 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Bash Twitter/Identi.ca Idiocy Group: Applications/Internet @@ -9,6 +9,7 @@ URL: http://www.kernel.org/pub/linux/kernel/people/gregkh/bti Source0: http://www.kernel.org/pub/linux/kernel/people/gregkh/bti/bti-%{version}.tar.bz2 Source1: README.Fedora Patch0: bti-028-readline5.patch +Patch1: bti-030-comment_marker.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if 0%{?el5} @@ -32,6 +33,7 @@ and fast manner to annoy the whole world. %else %patch0 -p1 -b .readline5 %endif +%patch1 -p1 -b .comment_marker cp -p %{SOURCE1} . @@ -66,6 +68,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Mar 18 2011 Michel Salim - 030-2 +- Improve detection of comment marker in configuration file + * Fri Mar 18 2011 Michel Salim - 030-1 - Update to 0.30