[yelp] Make the man: uri parser deal with more man page names



commit deb2ecc4fc6ef342992fefaafdc1ce8298be5533
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 27 12:41:35 2012 -0400

    Make the man: uri parser deal with more man page names
    
    The uri parser used to support both man:printf(1) and man:printf.1,
    but the support for the . variant comes at the cost of not supporting
    man:printers.conf. Since embedded periods in man pages are not that
    uncommon, in particular for file format documentation, this patch
    allows periods inside the name part of a man: uri, as long as it
    is not followed by a digit. This should cover pretty much all naturally
    occurring embedded periods, while still supporting the man:printf.1
    syntax.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676482

 libyelp/yelp-uri.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libyelp/yelp-uri.c b/libyelp/yelp-uri.c
index e21f893..e53062a 100644
--- a/libyelp/yelp-uri.c
+++ b/libyelp/yelp-uri.c
@@ -980,7 +980,7 @@ resolve_man_uri (YelpUri *uri)
         /* Match group 1 should contain the name; then one of groups 3
          * and 4 will contain the section if there was one. Group 6
          * will contain any hash fragment. */
-        man_not_path = g_regex_new ("man:([^ /.()#]+)"
+        man_not_path = g_regex_new ("man:((?:[^ /.()#]|\\.(?=[^0-9]))+)"
                                     "(\\(([0-9A-Za-z]+)\\)|\\.([0-9A-Za-z]+)|)"
                                     "(#([^/ ()]+))?",
                                     0, 0, &error);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]