about summary refs log tree commit diff stats
path: root/src/LYMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYMain.c')
-rw-r--r--src/LYMain.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/LYMain.c b/src/LYMain.c
index 9d9d7e03..851b93ae 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -268,6 +268,7 @@ PUBLIC char *bookmark_page = NULL; /* the name of the default bookmark page */
 PUBLIC char *BookmarkPage = NULL;  /* the name of the current bookmark page */
 PUBLIC char *LynxHome = NULL;	/* the default Home HREF. */
 PUBLIC char *homepage = NULL;  /* home page or main screen */
+PUBLIC char *original_dir = NULL; /* the original directory */
 PUBLIC char *startfile = NULL;	/* the first file */
 PUBLIC char *helpfile = NULL;	/* the main help file */
 PUBLIC char *helpfilepath = NULL;   /* the path to the help file set */
@@ -479,6 +480,7 @@ PRIVATE void free_lynx_globals NOARGS
 
     FREE(LynxHome);
     FREE(homepage);
+    FREE(original_dir);
     FREE(startfile);
     FREE(helpfile);
     FREE(helpfilepath);
@@ -1327,6 +1329,16 @@ PUBLIC int main ARGS2(
 #endif /* USE_COLOR_TABLE */
 
     /*
+     *  Set the original directory, used for default download
+     */
+    if (!strcmp(Current_Dir(filename), ".")) {
+	if ((cp = getenv("PWD")) != 0)
+	    StrAllocCopy(original_dir, cp);
+    } else {
+	StrAllocCopy(original_dir, filename);
+    }
+
+    /*
      *	Set the compilation default signature file. - FM
      */
     strcpy(filename, LYNX_SIG_FILE);