|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86701 - in trunk/tools/quickbook: src test/include
From: dnljms_at_[hidden]
Date: 2013-11-14 14:21:04
Author: danieljames
Date: 2013-11-14 14:21:04 EST (Thu, 14 Nov 2013)
New Revision: 86701
URL: http://svn.boost.org/trac/boost/changeset/86701
Log:
Only run glob in existing directories.
Maybe it should be an error if there are no matches.
Text files modified:
trunk/tools/quickbook/src/include_paths.cpp | 8 +++++---
trunk/tools/quickbook/test/include/glob-1_7.gold | 9 +++++++++
trunk/tools/quickbook/test/include/glob-1_7.quickbook | 12 ++++++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
Modified: trunk/tools/quickbook/src/include_paths.cpp
==============================================================================
--- trunk/tools/quickbook/src/include_paths.cpp Thu Nov 14 14:20:38 2013 (r86700)
+++ trunk/tools/quickbook/src/include_paths.cpp 2013-11-14 14:21:04 EST (Thu, 14 Nov 2013) (r86701)
@@ -102,10 +102,12 @@
path.data() + glob_begin,
glob_end - glob_begin);
+ fs::path base_dir = dir.empty() ? fs::path(".") : dir;
+ if (!fs::is_directory(base_dir)) return;
+
// Walk through the dir for matches.
- fs::directory_iterator dir_i(dir.empty() ? fs::path(".") : dir);
- fs::directory_iterator dir_e;
- for (; dir_i != dir_e; ++dir_i)
+ for (fs::directory_iterator dir_i(base_dir), dir_e;
+ dir_i != dir_e; ++dir_i)
{
fs::path f = dir_i->path().filename();
Modified: trunk/tools/quickbook/test/include/glob-1_7.gold
==============================================================================
--- trunk/tools/quickbook/test/include/glob-1_7.gold Thu Nov 14 14:20:38 2013 (r86700)
+++ trunk/tools/quickbook/test/include/glob-1_7.gold 2013-11-14 14:21:04 EST (Thu, 14 Nov 2013) (r86701)
@@ -2,6 +2,9 @@
<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<article id="glob_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Glob Test</title>
+ <section id="glob_test.t1_0">
+ <title><link linkend="glob_test.t1_0">Test 1.0</link></title>
+ </section>
<section id="glob_test.t1_1">
<title><link linkend="glob_test.t1_1">Test 1.1</link></title>
<para>
@@ -14,6 +17,12 @@
B
</para>
</section>
+ <section id="glob_test.t1_3">
+ <title><link linkend="glob_test.t1_3">Test 1.3</link></title>
+ <para>
+ B
+ </para>
+ </section>
<section id="glob_test.t2_1">
<title><link linkend="glob_test.t2_1">Test 2.1</link></title>
<para>
Modified: trunk/tools/quickbook/test/include/glob-1_7.quickbook
==============================================================================
--- trunk/tools/quickbook/test/include/glob-1_7.quickbook Thu Nov 14 14:20:38 2013 (r86700)
+++ trunk/tools/quickbook/test/include/glob-1_7.quickbook 2013-11-14 14:21:04 EST (Thu, 14 Nov 2013) (r86701)
@@ -2,6 +2,12 @@
[quickbook 1.7]
]
+[section:t1_0 Test 1.0]
+
+[include glob0/*]
+
+[endsect] [/t1_0]
+
[section:t1_1 Test 1.1]
[include glob1/*]
@@ -14,6 +20,12 @@
[endsect] [/t1_2]
+[section:t1_3 Test 1.3]
+
+[include glob1/*/b.qbk]
+
+[endsect] [/t1_3]
+
[section:t2_1 Test 2.1]
[include glob2/*]
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