From 3d8e759a4c8e495306d20e1c5c8085c3e2a7d864 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sat, 2 Feb 2002 07:13:02 +0000 Subject: [PATCH] Allow " symbol to be in regex without leading by checking for *ptr+1 is not the end of the regex git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1057 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ rcfile.c | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5837b93..ef05e44b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ CVS code - -C, --relative, changes to do_cursorpos(). - Makefile.am: - Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc. +- rcfile.c + parse_next_rege() + - Allow " symbol to be in regex without leading \ by checking + for *ptr+1 is not the end of the regex. - utils.c: strstrwrapper() - NANO_SMALL test was backwards (Ken Tyler). diff --git a/rcfile.c b/rcfile.c index 491cb308..45fca83b 100644 --- a/rcfile.c +++ b/rcfile.c @@ -131,11 +131,9 @@ char *parse_next_word(char *ptr) char *parse_next_regex(char *ptr) { - char prev = ' '; - while ((*ptr != '"' || prev == '\\') && *ptr != '\n' && *ptr != '\0') { - prev = *ptr; + while ((*ptr != '"' || (*(ptr+1) != ' ' && *(ptr+1) != '\n')) + && *ptr != '\n' && *ptr != '\0') ptr++; - } if (*ptr == '\0') return NULL; -- 2.39.5