Thread (11 messages) flat view 11 messages, 3 authors, 2016-06-15

Re: [PATCH v2 5/6] msvc: opendir: handle paths ending with a slash

From: René Scharfe <hidden>
Date: 2016-06-15 22:50:05

Am 23.11.2010 19:38, schrieb Erik Faye-Lund:
quoted hunk ↗ jump to hunk
Signed-off-by: Erik Faye-Lund <redacted>
---
 compat/msvc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/compat/msvc.c b/compat/msvc.c
index 199eb22..fdbfb70 100644
--- a/compat/msvc.c
+++ b/compat/msvc.c
@@ -23,6 +23,8 @@ DIR *opendir(const char *name)
 
 	/* check that the pattern won't be too long for FindFirstFileA */
 	len = strlen(name);
+	if (is_dir_sep(name[len - 1]))
Perhaps extend this thus, and handle multiple slashes?

	while (len > 0 && is_dir_sep(name[len - 1]))
+		len--;
 	if (len + 2 >= MAX_PATH) {
 		errno = ENAMETOOLONG;
 		return NULL;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help