]> git.lyx.org Git - lyx.git/blobdiff - src/support/globbing.C
make "make distcheck" work
[lyx.git] / src / support / globbing.C
index 0000f34e3a1b665111214f9ab512d3a1dccb97d1..dbc6b0ab4e6954fad73f86a570ba39926659e3da 100644 (file)
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "support/globbing.h"
+#include "support/path.h"
 
 #include <glob.h>
 
@@ -21,16 +22,22 @@ using std::vector;
 namespace lyx {
 namespace support {
 
-vector<string> const glob(string const & pattern, int flags)
+void glob(vector<string> & matches,
+         string const & pattern,
+         string const & working_dir,
+         int flags)
 {
+       Path p(working_dir);
+
        glob_t glob_buffer;
        glob_buffer.gl_offs = 0;
        glob(pattern.c_str(), flags, 0, &glob_buffer);
-       vector<string> const matches(glob_buffer.gl_pathv,
-                                    glob_buffer.gl_pathv +
-                                    glob_buffer.gl_pathc);
+
+       matches.insert(matches.end(),
+                      glob_buffer.gl_pathv,
+                      glob_buffer.gl_pathv + glob_buffer.gl_pathc);
+
        globfree(&glob_buffer);
-       return matches;
 }
 
 } // namespace support