diff options
author | ache <ache@FreeBSD.org> | 1997-02-18 14:26:24 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-02-18 14:26:24 +0000 |
commit | 97cd1933ff95f8aac581ea3907ac1c78871479c7 (patch) | |
tree | 572dc05ad3bd24254c1cb10c0ce8e515177b1206 /gnu/lib | |
parent | 6a229a98d5d18fdd2a27574f7631d07678842328 (diff) | |
download | FreeBSD-src-97cd1933ff95f8aac581ea3907ac1c78871479c7.zip FreeBSD-src-97cd1933ff95f8aac581ea3907ac1c78871479c7.tar.gz |
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
Diffstat (limited to 'gnu/lib')
-rw-r--r-- | gnu/lib/libdialog/fselect.c | 6 | ||||
-rw-r--r-- | gnu/lib/libdialog/ui_objects.c | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/gnu/lib/libdialog/fselect.c b/gnu/lib/libdialog/fselect.c index 4a8d075..6669edc 100644 --- a/gnu/lib/libdialog/fselect.c +++ b/gnu/lib/libdialog/fselect.c @@ -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); } diff --git a/gnu/lib/libdialog/ui_objects.c b/gnu/lib/libdialog/ui_objects.c index 8c178c6..dde1513 100644 --- a/gnu/lib/libdialog/ui_objects.c +++ b/gnu/lib/libdialog/ui_objects.c @@ -803,6 +803,7 @@ SelectButtonObj(ButtonObj *bo) case ctrl('b'): return(SEL_BACKTAB); case '\n': + case '\r': *(bo->pushed) = TRUE; return(SEL_BUTTON); break; |