From 4f8ac0b2d66dcbd94269e22f38989e1ed91a137c Mon Sep 17 00:00:00 2001 From: Geoff Voelker Date: Thu, 10 Dec 1998 05:43:07 +0000 Subject: [PATCH] (w32_get_long_filename): Handle root dirs correctly. --- src/w32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/w32.c b/src/w32.c index 46d95057edb..d50cff56793 100644 --- a/src/w32.c +++ b/src/w32.c @@ -503,9 +503,10 @@ w32_get_long_filename (char * name, char * buf, int size) len = parse_root (full, &p); memcpy (o, full, len); o += len; + *o = '\0'; size -= len; - do + while (p != NULL && *p) { q = p; p = strchr (q, '\\'); @@ -528,7 +529,6 @@ w32_get_long_filename (char * name, char * buf, int size) else return FALSE; } - while (p != NULL && *p); return TRUE; } -- 2.39.2