aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-08-10 15:05:27 +0000
committerMatt Kraai <kraai@debian.org>2001-08-10 15:05:27 +0000
commita7cecbc9170eed93d365c0c38e8ba1477ab0a40c (patch)
tree3541c27248b0d143cb06b9f61472b568414cb110 /util-linux
parent4fb0b517035ddc189bd696e3175bf18dbc37d441 (diff)
downloadbusybox-a7cecbc9170eed93d365c0c38e8ba1477ab0a40c.tar.gz
Commit Vladimir's simplify_path.
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)
if (optind < argc) {
/* if device is a filename get its real path */
if (stat(argv[optind], &statbuf) == 0) {
- realpath(argv[optind], device);
+ device = simplify_path(argv[optind]);
} else {
safe_strncpy(device, argv[optind], PATH_MAX);
}
}
- if (optind + 1 < argc) {
- if (realpath(argv[optind + 1], directory) == NULL) {
- perror_msg_and_die("%s", directory);
- }
- }
-
+ if (optind + 1 < argc)
+ directory = simplify_path(argv[optind + 1]);
+
if (all == TRUE || optind + 1 == argc) {
struct mntent *m = NULL;
FILE *f = setmntent("/etc/fstab", "r");