From 6cb8913967cc2e376926d38403975d182fb09af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 6 Apr 2016 10:11:08 +0200 Subject: [PATCH] Translated directory separators when running ntfscluster on Windows Use \ as a directory separator when running on Windows. --- ntfsprogs/ntfscluster.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ntfsprogs/ntfscluster.c b/ntfsprogs/ntfscluster.c index 6a7e7289..1f171634 100644 --- a/ntfsprogs/ntfscluster.c +++ b/ntfsprogs/ntfscluster.c @@ -486,6 +486,9 @@ int main(int argc, char *argv[]) struct match m; int res; int result = 1; +#ifdef HAVE_WINDOWS_H + char *unix_name; +#endif ntfs_log_set_handler(ntfs_log_handler_outerr); @@ -521,7 +524,17 @@ int main(int argc, char *argv[]) result = cluster_find(vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL); break; case act_file: +#ifdef HAVE_WINDOWS_H + unix_name = ntfs_utils_unix_path(opts.filename); + ino = 0; + if (unix_name) { + ino = ntfs_pathname_to_inode(vol, NULL, + unix_name); + free(unix_name); + } +#else ino = ntfs_pathname_to_inode(vol, NULL, opts.filename); +#endif if (ino) result = dump_file(vol, ino); break;