Skip to content

Commit c547824

Browse files
committed
Removed escape function from glob src
1 parent 0d15688 commit c547824

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

samples/glob_and_print_matches.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <glob/glob.hpp>
22
#include <iostream>
3-
namespace fs = std::filesystem;
43

54
int main(int argc, char *argv[]) {
65
if (argc < 2) {

src/glob.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,6 @@ std::vector<fs::path> iter_directory(const fs::path &dirname, bool dironly) {
183183
return result;
184184
}
185185

186-
// Escape all special characters.
187-
std::string escape(const std::string &pathname) {
188-
// Escaping is done by wrapping any of "*?[" between square brackets.
189-
// Meta-characters do not work in the drive part and shouldn't be escaped.
190-
191-
// drive, pathname = os.path.splitdrive(pathname)
192-
auto path = fs::path(pathname);
193-
auto drive = path.root_name();
194-
auto relative_path = path.relative_path();
195-
196-
static const auto magic_check = std::regex("([*?[])");
197-
// magic_check.sub(r'[\1]', pathname)
198-
relative_path = std::regex_replace(relative_path.string(), magic_check, R"([\1])");
199-
return drive / relative_path;
200-
}
201-
202186
// Recursively yields relative pathnames inside a literal directory.
203187
std::vector<fs::path> rlistdir(const fs::path &dirname, bool dironly) {
204188
std::vector<fs::path> result;

0 commit comments

Comments
 (0)