aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-08-10 15:05:27 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-08-10 15:05:27 +0000
commit1c42f38d32fb53ac26f7e6997cf146e309532b96 (patch)
tree3541c27248b0d143cb06b9f61472b568414cb110 /util-linux
parentcb59989ded3cbefe38243e7dee029fdac54b631f (diff)
downloadbusybox-w32-1c42f38d32fb53ac26f7e6997cf146e309532b96.tar.gz
busybox-w32-1c42f38d32fb53ac26f7e6997cf146e309532b96.tar.bz2
busybox-w32-1c42f38d32fb53ac26f7e6997cf146e309532b96.zip
Commit Vladimir's simplify_path.
git-svn-id: svn://busybox.net/trunk/busybox@3240 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index eb6091f30..6ffce2bf1 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -395,18 +395,15 @@ extern int mount_main(int argc, char **argv)
395 if (optind < argc) { 395 if (optind < argc) {
396 /* if device is a filename get its real path */ 396 /* if device is a filename get its real path */
397 if (stat(argv[optind], &statbuf) == 0) { 397 if (stat(argv[optind], &statbuf) == 0) {
398 realpath(argv[optind], device); 398 device = simplify_path(argv[optind]);
399 } else { 399 } else {
400 safe_strncpy(device, argv[optind], PATH_MAX); 400 safe_strncpy(device, argv[optind], PATH_MAX);
401 } 401 }
402 } 402 }
403 403
404 if (optind + 1 < argc) { 404 if (optind + 1 < argc)
405 if (realpath(argv[optind + 1], directory) == NULL) { 405 directory = simplify_path(argv[optind + 1]);
406 perror_msg_and_die("%s", directory); 406
407 }
408 }
409
410 if (all == TRUE || optind + 1 == argc) { 407 if (all == TRUE || optind + 1 == argc) {
411 struct mntent *m = NULL; 408 struct mntent *m = NULL;
412 FILE *f = setmntent("/etc/fstab", "r"); 409 FILE *f = setmntent("/etc/fstab", "r");