Skip to content

Commit 4851d08

Browse files
committed
fix: hopefully fix pathmatch crash
Resolves: #141
1 parent d3685bc commit 4851d08

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

src/Features/Pathmatch.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,6 @@ static double dc_get_time() {
136136
return (tp.tv_sec * 1e3) + (tp.tv_nsec / 1e6);
137137
}
138138

139-
template <size_t N>
140-
static void dc_fix_path(const char *path, char (&dest)[N]) {
141-
strncpy(dest, path, N);
142-
dest[N - 1] = 0;
143-
char *c = dest;
144-
while (*c) {
145-
c++;
146-
}
147-
// Chop off any / at the end of the line
148-
while (*c && *c == '/') {
149-
*c = 0;
150-
}
151-
}
152-
153139
/**
154140
* Find or populate the dir in the db
155141
* Calls readdir outright if the dir doesn't exist in the db yet,
@@ -237,9 +223,7 @@ dirent *dircache_readdir(dircontext_t *dir) {
237223

238224
// opendir(3)
239225
dircontext_t *dircache_opendir(const char *path) {
240-
char fixed[PATH_MAX]; // Correct any bad slashes
241-
dc_fix_path(path, fixed);
242-
return dc_find_or_populate(fixed);
226+
return dc_find_or_populate(path);
243227
}
244228

245229
// rewinddir(3)

0 commit comments

Comments
 (0)