Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8894/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
- Revert patch from Christophe applied by Yura.
- Provide a realpath() alternative for systems which do not have it.
This is _much_ nicer as it avoids the horrible #ifdef gunk in the code...
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -p -r1.40 -r1.41
--- ntfsmount.c 10 Oct 2005 11:04:56 -0000 1.40
+++ ntfsmount.c 10 Oct 2005 12:55:11 -0000 1.41
@@ -1336,6 +1336,16 @@ static void usage(void)
Eprintf("Default options are: \"%s\".\n", def_opts);
}
+#ifndef HAVE_REALPATH
+/* If there is no realpath() on the system, provide a dummy one. */
+static char *realpath(const char *path, char *resolved_path)
+{
+ strncpy(resolved_path, path, PATH_MAX);
+ resolved_path[PATH_MAX] = '\0';
+ return resolved_path;
+}
+#endif
+
/**
* parse_options - Read and validate the programs command line
*
@@ -1375,7 +1385,6 @@ static int parse_options(int argc, char
err++;
break;
}
-#ifdef HAVE_REALPATH
/* We don't want relative path in /etc/mtab. */
if (argv[optind - 1][0] != '/') {
if (!realpath(argv[optind - 1],
@@ -1388,9 +1397,6 @@ static int parse_options(int argc, char
}
} else
strcpy(opts.device, argv[optind - 1]);
-#else
- strcpy(opts.device, argv[optind - 1]);
-#endif
} else if (!opts.mnt_point)
opts.mnt_point = argv[optind - 1];
else {
|