[augeas-devel] augeas: master - * src/fa.c (special_chars): treat $ and ^ as special

David Lutterkort lutter at fedoraproject.org
Fri Oct 23 17:15:20 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=c259135a1c09b5711243e2eecc13877826d7d61d
Commit:        c259135a1c09b5711243e2eecc13877826d7d61d
Parent:        e96c70cd760b6021ce5206af0b317ddb730a86e5
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Fri Oct 23 17:34:11 2009 +0200
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Fri Oct 23 19:04:43 2009 +0200

* src/fa.c (special_chars): treat $ and ^ as special

They are special when they are at the beginning resp. the end of a regular
expression. Making them special (i.e., escaping them with '\') everywhere
doesn't hurt.
---
 src/fa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/fa.c b/src/fa.c
index a913071..3f5b314 100644
--- a/src/fa.c
+++ b/src/fa.c
@@ -3569,7 +3569,7 @@ static int re_iter_as_string(const struct re *re, struct re_str *str) {
 
 static int re_as_string(const struct re *re, struct re_str *str) {
     /* Characters that must be escaped */
-    static const char * const special_chars = ".()[]{}*+?\\";
+    static const char * const special_chars = ".()[]{}*+?\\^$";
     int result = 0;
 
     switch(re->type) {




More information about the augeas-devel mailing list