diff -ur davfs2-0.2.2.orig/src/mount.c davfs2-0.2.2/src/mount.c --- davfs2-0.2.2.orig/src/mount.c 2003-12-07 20:39:48.000000000 -0800 +++ davfs2-0.2.2/src/mount.c 2004-08-16 20:59:29.000000000 -0700 @@ -275,17 +275,6 @@ { 0, 0, 0, 0 } }; - /* at least three args */ - if(argc>2) { - /* We want to mount directory, right?? */ - if( *(argv[1] + strlen(argv[1]) -1) == '/' ) - mopt->url = ne_strdup(argv[1]); - else - mopt->url = ne_concat(argv[1], "/", NULL); - - mopt->mpoint = ne_strdup(argv[2]); - } - /* It can be a -v option */ while ((optc = getopt_long(argc, argv, "ho:v", opts, NULL)) != -1) { switch (optc) { @@ -308,6 +297,14 @@ if(argc<3) return -1; + /* We want to mount directory, right?? */ + if( *(argv[argc-2] + strlen(argv[argc-2]) -1) == '/' ) + mopt->url = ne_strdup(argv[argc-2]); + else + mopt->url = ne_concat(argv[argc-2], "/", NULL); + + mopt->mpoint = ne_strdup(argv[argc-1]); + /* parse option */ /* Do we need to check return ?? */ dav_mopt_parse(mopt->option, mopt);