]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/uxsftp.c
Centralise stripslashes() and make it OS-sensitive.
[PuTTY.git] / unix / uxsftp.c
index 7039b69b5c2d1ace1663b0c00a529a03ee5a449e..3ac1d2c346470242955b96ff61825284e78126f0 100644 (file)
@@ -413,6 +413,20 @@ void finish_wildcard_matching(WildcardMatcher *dir) {
     sfree(dir);
 }
 
+char *stripslashes(const char *str, int local)
+{
+    char *p;
+
+    /*
+     * On Unix, we do the same thing regardless of the 'local'
+     * parameter.
+     */
+    p = strrchr(str, '/');
+    if (p) str = p+1;
+
+    return (char *)str;
+}
+
 int vet_filename(const char *name)
 {
     if (strchr(name, '/'))