From abba388447ebbb69cbb37701880b2d883329702b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 26 Apr 2013 19:07:47 +0200 Subject: [PATCH] Fixed the reversing of slashes in relative Windows-type symlinks When translating Windows-type symlinks to Linux ones, the directory separator has to be changed from '\' to '/'. The change was wrong for multiple "..\" and ".\" --- libntfs-3g/reparse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libntfs-3g/reparse.c b/libntfs-3g/reparse.c index dc44bcd0..cdabadd2 100644 --- a/libntfs-3g/reparse.c +++ b/libntfs-3g/reparse.c @@ -3,7 +3,7 @@ * * This module is part of ntfs-3g library * - * Copyright (c) 2008-2012 Jean-Pierre Andre + * Copyright (c) 2008-2013 Jean-Pierre Andre * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -313,14 +313,14 @@ static char *search_relative(ntfs_inode *ni, ntfschar *path, int count) if ((count >= (pos + 2)) && (path[pos] == const_cpu_to_le16('.')) && (path[pos+1] == const_cpu_to_le16('\\'))) { - path[1] = const_cpu_to_le16('/'); + path[pos+1] = const_cpu_to_le16('/'); pos += 2; } else { if ((count >= (pos + 3)) && (path[pos] == const_cpu_to_le16('.')) &&(path[pos+1] == const_cpu_to_le16('.')) && (path[pos+2] == const_cpu_to_le16('\\'))) { - path[2] = const_cpu_to_le16('/'); + path[pos+2] = const_cpu_to_le16('/'); pos += 3; newni = ntfs_dir_parent_inode(curni); if (curni != ni)