Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86707 - in trunk/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2013-11-14 14:24:34


Author: danieljames
Date: 2013-11-14 14:24:34 EST (Thu, 14 Nov 2013)
New Revision: 86707
URL: http://svn.boost.org/trac/boost/changeset/86707

Log:
Make unicode globs invalid.

Added:
   trunk/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook (contents, props changed)
Text files modified:
   trunk/tools/quickbook/src/glob.cpp | 8 ++++++++
   trunk/tools/quickbook/test/Jamfile.v2 | 1 +
   trunk/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook | 5 +++++
   3 files changed, 14 insertions(+), 0 deletions(-)

Modified: trunk/tools/quickbook/src/glob.cpp
==============================================================================
--- trunk/tools/quickbook/src/glob.cpp Thu Nov 14 14:24:01 2013 (r86706)
+++ trunk/tools/quickbook/src/glob.cpp 2013-11-14 14:24:34 EST (Thu, 14 Nov 2013) (r86707)
@@ -24,11 +24,15 @@
     bool check_glob(boost::string_ref pattern)
     {
         bool is_glob = false;
+ bool is_ascii = true;
 
         glob_iterator begin = pattern.begin();
         glob_iterator end = pattern.end();
 
         while (begin != end) {
+ if (*begin < 32 || *begin > 127)
+ is_ascii = false;
+
             switch(*begin) {
                 case '\\':
                     check_glob_escape(begin, end);
@@ -61,6 +65,9 @@
             }
         }
 
+ if (is_glob && !is_ascii)
+ throw glob_error("invalid character, globs are ascii only");
+
         return is_glob;
     }
 
@@ -137,6 +144,7 @@
         while (pattern_it != pattern_end) {
             assert(*pattern_it == '*');
             ++pattern_it;
+
             if (pattern_it == pattern_end) return true;
 
             // TODO: Error?

Modified: trunk/tools/quickbook/test/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/test/Jamfile.v2 Thu Nov 14 14:24:01 2013 (r86706)
+++ trunk/tools/quickbook/test/Jamfile.v2 2013-11-14 14:24:34 EST (Thu, 14 Nov 2013) (r86707)
@@ -71,6 +71,7 @@
     [ quickbook-error-test include_invalid_path1-1_7-fail ]
     [ quickbook-error-test include_invalid_path2-1_7-fail ]
     [ quickbook-error-test include_invalid_path3-1_7-fail ]
+ [ quickbook-error-test include_unicode_glob-1_7-fail ]
     [ quickbook-test link-1_1 ]
     [ quickbook-test link-1_6 ]
     [ quickbook-test link-1_7 ]

Added: trunk/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/tools/quickbook/test/include_unicode_glob-1_7-fail.quickbook 2013-11-14 14:24:34 EST (Thu, 14 Nov 2013) (r86707)
@@ -0,0 +1,5 @@
+[article Unicode glob
+[quickbook 1.7]
+]
+
+[include £*.quickbook]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk