diff --git a/src/browser.c b/src/browser.c index 4fcc3d4..e934591 100644 --- a/src/browser.c +++ b/src/browser.c @@ -370,7 +370,7 @@ int browse_key(int ch) { info_show = 0; break; case 'd': - if(sel == NULL || sel == dirlist_parent) + if(read_only || sel == NULL || sel == dirlist_parent) break; info_show = 0; if((t = dirlist_get(1)) == sel) diff --git a/src/global.h b/src/global.h index ceb1a2b..71151b5 100644 --- a/src/global.h +++ b/src/global.h @@ -71,6 +71,8 @@ struct dir { /* program state */ extern int pstate; +/* read-only flag */ +extern int read_only; /* minimum screen update interval when calculating, in ms */ extern long update_delay; diff --git a/src/main.c b/src/main.c index 35aaae9..ed1ce66 100644 --- a/src/main.c +++ b/src/main.c @@ -37,6 +37,7 @@ int pstate; int min_rows = 17, min_cols = 60; +int read_only = 0; long update_delay = 100, lastupdate = 999; @@ -118,6 +119,7 @@ char *argv_parse(int argc, char **argv) { for(j=1; j