mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
852 B

--- ./mount/mount.c.orig 2004-12-30 17:59:42.242468848 +0100
+++ ./mount/mount.c 2004-12-30 18:00:26.571729776 +0100
@@ -1159,6 +1159,23 @@
/* Substitute values in opts, if required */
opts = usersubst(opts);
+ /* make the node a nice absolute path name */
+ if (node[0] && node[0]!='/') {
+ char *thisdir=get_current_dir_name();
+ char *oldnode=node;
+ if (chdir(node) == 0) {
+ /* we will never free this variable ... */
+ node=get_current_dir_name();
+ chdir(thisdir);
+ if (verbose) printf("mount: change '%s' to '%s'\n",oldnode,node);
+ }
+ free(thisdir);
+ }
+ if (strlen(node)>=3 && node[strlen(node)-1]=='/') {
+ if (verbose) printf("mount: remove the leading '/' in '%s'\n",node);
+ node[strlen(node)-1]=0;
+ }
+
/* Merge the fstab and command line options. */
if (opts == NULL)
opts = cmdlineopts;