--- src/mtoolsfm.c 2001-08-27 08:45:25.000000000 +0200 +++ src/mtoolsfm.c.1 2003-07-04 20:24:03.000000000 +0200 @@ -85,6 +85,10 @@ char *homedir; int debug=0; +char *leftpath = ""; +char *rightpath = ""; +int sidecount=0; + /* should a configuration file ~/.mtoolsfm be written in user's homedir ? */ #ifdef DEFAULT_NOSAVE int nosave=1; @@ -652,6 +656,7 @@ char *nextposition; unsigned int path_length=50; unsigned int path_add=50; + sidecount++; if (debug) { printf ("In gethdpath()\n"); @@ -660,11 +665,19 @@ clearpath (whichside); errno = 0; path = malloc (path_length * sizeof (char)); + if (sidecount == 1 && strlen(leftpath) != 0) { + strcpy(path, leftpath); + } + else if (sidecount == 2 && strlen(rightpath) != 0) { + strcpy(path, rightpath); + } + else { while ((!getcwd (path, path_length - 2)) && (errno == ERANGE)) { if (debug) printf(" getcwd buffer resize: errno=%d, path_length=%d, path=%s\n",errno,path_length,path); path = g_realloc (path, (path_length+=path_add) * sizeof (char)); } + } strcat (path, "/"); if (debug) printf (" path: %s\n", path); @@ -2920,6 +2933,20 @@ debug = 1; else if (!strcmp (argv[i], "--debug")) debug = 1; + else if (!strncmp (argv[i], "--leftpath", 10)) { + leftpath = strchr(argv[i], '='); + if(leftpath) { + *leftpath = 0; + leftpath++; + } + } + else if (!strncmp (argv[i], "--rightpath", 11)) { + rightpath = strchr(argv[i], '='); + if(rightpath) { + *rightpath = 0; + rightpath++; + } + } else if (!strcmp (argv[i], "--help")) { g_print ("\n%s%s\n%s%s%s\n",ABOUTMTOOLSFM_1,ABOUTMTOOLSFM_2, MTOOLSFMOPTIONS_1,CONFFILE,MTOOLSFMOPTIONS_2);