Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/ntfsprogs
In directory delta357:/tmp/cvs-serv20451/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
use optarg instead of argv[optind - 1]
Index: ntfsmount.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -p -r1.94 -r1.95
--- ntfsmount.c 15 Nov 2006 23:15:17 -0000 1.94
+++ ntfsmount.c 17 Nov 2006 22:14:55 -0000 1.95
@@ -1694,22 +1694,20 @@ static int parse_options(int argc, char
break;
}
/* We don't want relative path in /etc/mtab. */
- if (argv[optind - 1][0] != '/') {
- if (!realpath(argv[optind - 1],
- opts.device)) {
+ if (optarg[0] != '/') {
+ if (!realpath(optarg, opts.device)) {
ntfs_log_perror("Failed to "
"access %s",
- argv[optind -
- 1]);
+ optarg);
free(opts.device);
opts.device = NULL;
err++;
break;
}
} else
- strcpy(opts.device, argv[optind - 1]);
+ strcpy(opts.device, optarg);
} else if (!opts.mnt_point)
- opts.mnt_point = argv[optind - 1];
+ opts.mnt_point = optarg;
else {
ntfs_log_error("You must specify exactly one "
"device and exactly one mount "
@@ -1719,7 +1717,7 @@ static int parse_options(int argc, char
break;
case 'o':
if (!opts.options)
- opts.options = argv[optind - 1];
+ opts.options = optarg;
else {
ntfs_log_error("You must specify exactly one "
"set of options.\n");
@@ -1737,8 +1735,7 @@ static int parse_options(int argc, char
opts.verbose++;
break;
default:
- ntfs_log_error("Unknown option '%s'.\n",
- argv[optind - 1]);
+ ntfs_log_error("Unknown option '%s'.\n", optarg);
err++;
break;
}
|