mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 10:29:15 +00:00
When wrong directory choosed and chdir failed, directory name
was not reset to old name causing any file choosen put error diagnostic about wrong directory, fix it by resetting back to old name after chdir failed. Add \r as alias to \n, some telnets have problem with that. Should go into 2.2 Submitted by: "Anatoly A. Orehovsky" <tolik@mpeks.tomsk.su> & me
This commit is contained in:
parent
697030ed3d
commit
113b1c5fe5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22879
@ -171,11 +171,12 @@ dialog_dselect_old(void)
|
||||
/* the directory was changed, cd into it */
|
||||
if (chdir(o_dir)) {
|
||||
dialog_notify("Could not change into directory");
|
||||
strcpy(o_dir, old_dir);
|
||||
} else {
|
||||
getcwd(o_dir, MAXPATHLEN);
|
||||
strcpy(old_dir, o_dir);
|
||||
RefreshStringObj(dir_obj);
|
||||
}
|
||||
RefreshStringObj(dir_obj);
|
||||
}
|
||||
get_dir(".", "*", &d, &n);
|
||||
FreeNames(names, nd);
|
||||
@ -344,11 +345,12 @@ dialog_dfselect(char *dir, char *fmask, int is_fselect)
|
||||
if (strcmp(old_dir, o_dir)) { /* dir entry was changed */
|
||||
if (chdir(o_dir)) {
|
||||
dialog_notify("Could not change into directory");
|
||||
strcpy(o_dir, old_dir);
|
||||
} else {
|
||||
getcwd(o_dir, MAXPATHLEN);
|
||||
strcpy(old_dir, o_dir);
|
||||
RefreshStringObj(dir_obj);
|
||||
}
|
||||
RefreshStringObj(dir_obj);
|
||||
} else { /* fmask entry was changed */
|
||||
strcpy(old_fmask, o_fm);
|
||||
}
|
||||
|
@ -803,6 +803,7 @@ SelectButtonObj(ButtonObj *bo)
|
||||
case ctrl('b'):
|
||||
return(SEL_BACKTAB);
|
||||
case '\n':
|
||||
case '\r':
|
||||
*(bo->pushed) = TRUE;
|
||||
return(SEL_BUTTON);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user