diff -ur original-src/browser.c my-src/browser.c --- original-src/browser.c 2016-02-26 02:17:10.000000000 +0530 +++ my-src/browser.c 2016-04-24 21:10:44.748181345 +0530 @@ -78,6 +78,7 @@ kbinput = ERR; path = mallocstrassn(path, get_full_path(path)); + path_for_tab_c = mallocstrcpy(path_for_tab_c, path); /* Save the current path in order to be used later. */ path_save = path; Only in my-src/: .deps diff -ur original-src/files.c my-src/files.c --- original-src/files.c 2016-02-26 02:17:10.000000000 +0530 +++ my-src/files.c 2016-04-24 21:10:44.748181345 +0530 @@ -2713,7 +2713,11 @@ free(tmpdirname); } else { filename = dirname; - dirname = mallocstrcpy(NULL, "./"); + dirname = mallocstrcpy(NULL, path_for_tab_c); + if (dirname[strlen(dirname) - 1] != '/') { + dirname = realloc(dirname, PATH_MAX + 1); + strcat(dirname, "/"); + } } assert(dirname[strlen(dirname) - 1] == '/'); diff -ur original-src/global.c my-src/global.c --- original-src/global.c 2016-02-22 20:17:49.000000000 +0530 +++ my-src/global.c 2016-04-24 21:10:44.748181345 +0530 @@ -40,6 +40,8 @@ /* Whether the current keystroke is an extended keypad value. */ bool focusing = FALSE; /* Whether an update of the edit window should center the cursor. */ +char *path_for_tab_c = NULL; + /* Stores current path in browser for cwd_tab_completion(). */ #ifndef NANO_TINY int controlleft = CONTROL_LEFT; diff -ur original-src/proto.h my-src/proto.h --- original-src/proto.h 2016-02-26 02:17:10.000000000 +0530 +++ my-src/proto.h 2016-04-24 21:10:44.752181345 +0530 @@ -34,6 +34,7 @@ extern bool meta_key; extern bool func_key; extern bool focusing; +extern char *path_for_tab_c; #ifndef NANO_TINY extern int controlleft;