[augeas-devel] augeas: master - * src/regexp.c (print_regexp): clean the regexp with fa_restrict_alphabet

David Lutterkort lutter at fedoraproject.org
Wed Dec 23 20:29:00 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=672d154eb7d7d3ed59b02df95aa71973dbb87b75
Commit:        672d154eb7d7d3ed59b02df95aa71973dbb87b75
Parent:        232fe557bdf3ce1f0149d941f3a55affb9e94f11
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Wed Nov 11 16:04:02 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Wed Dec 23 12:18:25 2009 -0800

* src/regexp.c (print_regexp): clean the regexp with fa_restrict_alphabet

---
 src/regexp.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/regexp.c b/src/regexp.c
index 85dea58..55075df 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -100,8 +100,14 @@ void print_regexp(FILE *out, struct regexp *r) {
     fputc('/', out);
     if (r->pattern == NULL)
         fprintf(out, "%p", r);
-    else
-        print_chars(out, r->pattern->str, -1);
+    else {
+        char *rx;
+        size_t rx_len;
+        fa_restrict_alphabet(r->pattern->str, strlen(r->pattern->str),
+                             &rx, &rx_len, 2, 1);
+        print_chars(out, rx, rx_len);
+        FREE(rx);
+    }
     fputc('/', out);
 }
 




More information about the augeas-devel mailing list