search for: setinputfil

Displaying 6 results from an estimated 6 matches for "setinputfil".

Did you mean: setinputfile
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle -- in dotcmd
...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; }
2019 Jan 25
0
[klibc:update-dash] eval: Restore input files in evalcommand
...@ popfile(void) void popallfiles(void) { - while (parsefile != &basepf) - popfile(); + unwindfiles(&basepf); } diff --git a/usr/dash/input.h b/usr/dash/input.h index ec97c1d6..a9c05174 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -97,5 +97,6 @@ void popstring(void); int setinputfile(const char *, int); void setinputstring(char *); void popfile(void); +void unwindfiles(struct parsefile *); void popallfiles(void); void closescript(void);
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle -- in dotcmd
...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: options: Do not set commandname in procargs
...: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/options.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr/dash/options.c b/usr/dash/options.c index 6f381e61..a46c23b9 100644 --- a/usr/dash/options.c +++ b/usr/dash/options.c @@ -159,7 +159,6 @@ procargs(int argc, char **argv) setinputfile(*xargv, 0); setarg0: arg0 = *xargv++; - commandname = arg0; } shellparam.p = xargv;
2020 Mar 28
0
[klibc:update-dash] dash: eval: Restore input files in evalcommand
...@ popfile(void) void popallfiles(void) { - while (parsefile != &basepf) - popfile(); + unwindfiles(&basepf); } diff --git a/usr/dash/input.h b/usr/dash/input.h index ec97c1d6..a9c05174 100644 --- a/usr/dash/input.h +++ b/usr/dash/input.h @@ -97,5 +97,6 @@ void popstring(void); int setinputfile(const char *, int); void setinputstring(char *); void popfile(void); +void unwindfiles(struct parsefile *); void popallfiles(void); void closescript(void);
2007 Aug 23
0
[git patch] klibc dash 0.5.4 update
...itutes savefd. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: maximilian attems <max at stro.at> diff --git a/usr/dash/input.c b/usr/dash/input.c index 49a2972..7f99d4a 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -428,7 +428,6 @@ int setinputfile(const char *fname, int flags) { int fd; - int fd2; INTOFF; if ((fd = open(fname, O_RDONLY)) < 0) { @@ -436,11 +435,8 @@ setinputfile(const char *fname, int flags) goto out; sh_error("Can't open %s", fname); } - if (fd < 10) { - fd2 = copyfd(fd, 10); - close(...