From bb9e66e265a43fb2fe4114df899d23eb9c3cfc39 Mon Sep 17 00:00:00 2001 From: Dave Hawkes Date: Sun, 25 Jun 2000 12:46:40 +0000 Subject: [PATCH] If whitespace or dots are appended to the end of any component in a path then it should be ignored. --- files/dos_fs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/files/dos_fs.c b/files/dos_fs.c index 0d1263ee61c..dec37faff88 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c @@ -530,8 +530,8 @@ BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, const char *p = strchr( name, '/' ); int len = p ? (int)(p - name) : strlen(name); if ((p = strchr( name, '\\' ))) len = min( (int)(p - name), len ); - /* Ignore trailing dots */ - while (len > 1 && name[len-1] == '.') len--; + /* Ignore trailing dots and spaces */ + while (len > 1 && (name[len-1] == '.' || name[len-1] == ' ')) len--; if (long_len < len + 1) return FALSE; TRACE("%s,%s\n", path, name ); @@ -855,6 +855,11 @@ BOOL DOSFS_GetFullName( LPCSTR name, BOOL check_last, DOS_FULL_NAME *full ) else *p_l++ = *name; name++; } + /* Ignore trailing dots and spaces */ + while(p_l[-1] == '.' || p_l[-1] == ' ') { + --p_l; + --p_s; + } *p_l = *p_s = '\0'; } while ((*name == '\\') || (*name == '/')) name++;