Ticket #1828: 01_ftpfs_symlink.patch

File 01_ftpfs_symlink.patch, 1.0 KB (added by zaytsev, 14 years ago)
  • vfs/direntry.c

    diff --git a/vfs/direntry.c b/vfs/direntry.c
    index 3a52d22..b1dfdca 100644
    a b vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root, 
    251251    char * const pathref = g_strdup (a_path); 
    252252    char *path = pathref; 
    253253 
    254     canonicalize_pathname (path); 
     254    if (strncmp(me->name, "ftpfs", 5) != 0) 
     255        canonicalize_pathname (path); 
     256    else { 
     257        char *p = path + strlen (path) - 1; 
     258        while (p > path && *p == PATH_SEP) 
     259            *p-- = 0; 
     260    } 
    255261 
    256262    while (root) { 
    257263        while (*path == PATH_SEP)       /* Strip leading '/' */ 
    vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root, 
    324330    if (root->super->root != root) 
    325331        vfs_die ("We have to use _real_ root. Always. Sorry."); 
    326332 
    327     canonicalize_pathname (path); 
     333    if (strncmp (me->name, "ftpfs", 5) != 0) 
     334        canonicalize_pathname (path); 
     335    else { 
     336        char *p = path + strlen (path) - 1; 
     337        while (p > path && *p == PATH_SEP) 
     338            *p-- = 0; 
     339    } 
    328340 
    329341    if (!(flags & FL_DIR)) { 
    330342        char *dirname, *name, *save;