Displaying 5 results from an estimated 5 matches for "find_dot_fil".
Did you mean:
find_dot_file
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle -- in dotcmd
...in.c
index 00c5e00d..985e8c4e 100644
--- a/usr/dash/main.c
+++ b/usr/dash/main.c
@@ -321,15 +321,19 @@ dotcmd(int argc, char **argv)
{
int status = 0;
- if (argc >= 2) { /* That's what SVR2 does */
+ nextopt(nullstr);
+ argv = argptr;
+
+ if (*argv) {
char *fullname;
- fullname = find_dot_file(argv[1]);
+ fullname = find_dot_file(*argv);
setinputfile(fullname, INPUT_PUSH_FILE);
commandname = fullname;
status = cmdloop(0);
popfile();
}
+
return status;
}
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle -- in dotcmd
...in.c
index 00c5e00d..985e8c4e 100644
--- a/usr/dash/main.c
+++ b/usr/dash/main.c
@@ -321,15 +321,19 @@ dotcmd(int argc, char **argv)
{
int status = 0;
- if (argc >= 2) { /* That's what SVR2 does */
+ nextopt(nullstr);
+ argv = argptr;
+
+ if (*argv) {
char *fullname;
- fullname = find_dot_file(argv[1]);
+ fullname = find_dot_file(*argv);
setinputfile(fullname, INPUT_PUSH_FILE);
commandname = fullname;
status = cmdloop(0);
popfile();
}
+
return status;
}
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...e the pathopt.
This is so that it is less likely that a genuine directory containing
a % sign is parsed as a pathopt.
Users of padvance outside of exec.c have also been modified:
1) cd(1) will always treat % characters as part of the path.
2) chkmail will continue to accept arbitrary pathopt.
3) find_dot_file will ignore the %builtin pathopt instead of trying
to do a stat in the accompanying directory (which is usually the
current directory).
The patch also removes the clearcmdentry optimisation where we
attempt to only partially flush the table where possible.
Signed-off-by: Herbert Xu <herbert a...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...git a/usr/dash/main.c b/usr/dash/main.c
index 6b3a0909..b2712cbd 100644
--- a/usr/dash/main.c
+++ b/usr/dash/main.c
@@ -71,6 +71,7 @@ int *dash_errno;
short profile_buf[16384];
extern int etext();
#endif
+static struct jmploc main_handler;
STATIC void read_profile(const char *);
STATIC char *find_dot_file(char *);
@@ -90,7 +91,6 @@ main(int argc, char **argv)
{
char *shinit;
volatile int state;
- struct jmploc jmploc;
struct stackmark smark;
int login;
@@ -102,7 +102,7 @@ main(int argc, char **argv)
monitor(4, etext, profile_buf, sizeof profile_buf, 50);
#endif
state = 0;
- if (unli...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Do not allocate stack string in padvance
...+
+ len = padvance(&mpath, nullstr);
+ if (!len)
break;
+ p = stackblock();
if (*p == '\0')
continue;
for (q = p ; *q ; q++);
diff --git a/usr/dash/main.c b/usr/dash/main.c
index 8b351189..c87fbd73 100644
--- a/usr/dash/main.c
+++ b/usr/dash/main.c
@@ -292,20 +292,18 @@ find_dot_file(char *basename)
char *fullname;
const char *path = pathval();
struct stat statb;
+ int len;
/* don't try this for absolute or relative paths */
if (strchr(basename, '/'))
return basename;
- while ((fullname = padvance(&path, basename)) != NULL) {
+ while ((len = pa...