aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2016-02-10 15:32:41 +0000
committersin <sin@2f30.org>2016-02-10 15:32:41 +0000
commit5629b4911354876c9b88fe668bd4b17382c79f75 (patch)
treeda26edb77bbcd2658e0e057d479f311431e4c6a2 /noice.c
parent5456b8a36a4bac19968ba39ba25d04981a4eee79 (diff)
downloadnoice-5629b4911354876c9b88fe668bd4b17382c79f75.tar.gz
Move path[], oldpath[] and fltr[] inside browse()
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/noice.c b/noice.c
index 632cef3..7f2f873 100644
--- a/noice.c
+++ b/noice.c
@@ -81,8 +81,6 @@ struct entry {
/* Global context */
struct entry *dents;
int ndents, cur;
-char path[PATH_MAX], oldpath[PATH_MAX];
-char fltr[LINE_MAX];
int idle;
/*
@@ -486,7 +484,7 @@ dentfind(struct entry *dents, int n, char *cwd, char *path)
}
int
-populate(void)
+populate(char *path, char *oldpath, char *fltr)
{
regex_t re;
int r;
@@ -515,7 +513,7 @@ populate(void)
}
void
-redraw(void)
+redraw(char *path)
{
char cwd[PATH_MAX], cwdresolved[PATH_MAX];
size_t ncols;
@@ -565,7 +563,8 @@ redraw(void)
void
browse(char *ipath, char *ifilter)
{
- char newpath[PATH_MAX];
+ char path[PATH_MAX], oldpath[PATH_MAX], newpath[PATH_MAX];
+ char fltr[LINE_MAX];
char *bin, *dir, *tmp, *run, *env;
struct stat sb;
regex_t re;
@@ -573,15 +572,16 @@ browse(char *ipath, char *ifilter)
strlcpy(path, ipath, sizeof(path));
strlcpy(fltr, ifilter, sizeof(fltr));
+ oldpath[0] = '\0';
begin:
- r = populate();
+ r = populate(path, oldpath, fltr);
if (r == -1) {
printwarn();
goto nochange;
}
for (;;) {
- redraw();
+ redraw(path);
nochange:
switch (nextsel(&run, &env)) {
case SEL_QUIT:
Un proyecto texto-plano.xyz