diff --no-dereference -Naur -- dash.normalized/src/cd.c dash.srctix/src/cd.c --- dash.normalized/src/cd.c 2011-03-15 08:18:06.000000000 +0100 +++ dash.srctix/src/cd.c 2014-03-05 22:37:01.573462868 +0100 @@ -252,7 +252,7 @@ STATIC char * getpwd() { -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__sortix__) char *dir = getcwd(0, 0); if (dir) diff --no-dereference -Naur -- dash.normalized/src/exec.c dash.srctix/src/exec.c --- dash.normalized/src/exec.c 2011-03-15 08:45:32.000000000 +0100 +++ dash.srctix/src/exec.c 2014-07-06 21:34:58.557495010 +0200 @@ -151,6 +151,9 @@ STATIC void tryexec(char *cmd, char **argv, char **envp) { +#if defined(__sortix__) + execvpe((const char*) cmd, argv, envp); +#else char *const path_bshell = _PATH_BSHELL; repeat: @@ -166,6 +169,7 @@ *argv = cmd = path_bshell; goto repeat; } +#endif } diff --no-dereference -Naur -- dash.normalized/src/histedit.c dash.srctix/src/histedit.c --- dash.normalized/src/histedit.c 2011-03-15 08:18:06.000000000 +0100 +++ dash.srctix/src/histedit.c 2021-02-13 23:06:09.234182385 +0100 @@ -32,7 +32,6 @@ * SUCH DAMAGE. */ -#include #ifdef HAVE_PATHS_H #include #endif diff --no-dereference -Naur -- dash.normalized/src/jobs.c dash.srctix/src/jobs.c --- dash.normalized/src/jobs.c 2011-03-15 08:45:32.000000000 +0100 +++ dash.srctix/src/jobs.c 2021-02-13 23:06:09.246182457 +0100 @@ -40,7 +40,6 @@ #include #endif #include -#include #ifdef BSD #include #include @@ -207,7 +206,7 @@ mflag = on = 0; goto close; } - if (pgrp == getpgrp()) + if (pgrp == getpgid(0)) break; killpg(0, SIGTTIN); } while (1); @@ -457,7 +456,7 @@ if (mode & SHOW_PGID) { /* just output process (group) id of pipeline */ - outfmt(out, "%d\n", ps->pid); + outfmt(out, "%jd\n", (intmax_t) ps->pid); return; } @@ -470,7 +469,7 @@ s[col - 2] = '-'; if (mode & SHOW_PID) - col += fmtstr(s + col, 16, "%d ", ps->pid); + col += fmtstr(s + col, 16, "%jd ", (intmax_t) ps->pid); psend = ps + jp->nprocs; @@ -490,7 +489,7 @@ do { /* for each process */ - col = fmtstr(s, 48, " |\n%*c%d ", indent, ' ', ps->pid) - 3; + col = fmtstr(s, 48, " |\n%*c%jd ", indent, ' ', (intmax_t) ps->pid) - 3; start: outfmt( @@ -1136,7 +1135,7 @@ do { gotsigchld = 0; - err = wait3(status, flags, NULL); + err = waitpid(-1, status, flags); if (err || !block) break; diff --no-dereference -Naur -- dash.normalized/src/Makefile.in dash.srctix/src/Makefile.in --- dash.normalized/src/Makefile.in 2011-07-08 11:00:39.000000000 +0200 +++ dash.srctix/src/Makefile.in 2014-06-22 22:50:53.966698841 +0200 @@ -170,9 +170,9 @@ AM_CFLAGS = $(COMMON_CFLAGS) AM_CPPFLAGS = $(COMMON_CPPFLAGS) AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS) -AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS) +AM_CPPFLAGS_FOR_BUILD = -DBSD=1 -DSHELL -DIFS_BROKEN COMPILE_FOR_BUILD = \ - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \ + unset HOST_SYSTEM_ROOT && $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \ $(CPPFLAGS_FOR_BUILD) \ $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) @@ -542,7 +542,11 @@ info-am: -install-data-am: install-man +install-data-am: install-man install-proper-shells + +install-proper-shells: + mkdir -p "$(DESTDIR)$(sysconfdir)/proper-shells" + echo dash > "$(DESTDIR)$(sysconfdir)/proper-shells/dash" install-dvi: install-dvi-am diff --no-dereference -Naur -- dash.normalized/src/miscbltin.c dash.srctix/src/miscbltin.c --- dash.normalized/src/miscbltin.c 2011-03-15 08:18:06.000000000 +0100 +++ dash.srctix/src/miscbltin.c 2021-02-13 23:06:09.246182457 +0100 @@ -37,7 +37,6 @@ */ #include /* quad_t */ -#include /* BSD4_4 */ #include #include #include diff --no-dereference -Naur -- dash.normalized/src/output.c dash.srctix/src/output.c --- dash.normalized/src/output.c 2011-03-15 08:18:06.000000000 +0100 +++ dash.srctix/src/output.c 2021-02-13 23:06:09.250182482 +0100 @@ -44,7 +44,6 @@ */ #include /* quad_t */ -#include /* BSD4_4 */ #include #include /* defines BUFSIZ */ diff --no-dereference -Naur -- dash.normalized/src/parser.c dash.srctix/src/parser.c --- dash.normalized/src/parser.c 2011-07-07 07:54:12.000000000 +0200 +++ dash.srctix/src/parser.c 2021-02-13 23:06:09.250182482 +0100 @@ -32,10 +32,6 @@ * SUCH DAMAGE. */ -#if HAVE_ALLOCA_H -#include -#endif - #include #include "shell.h" @@ -1090,10 +1086,12 @@ if (len) { char *str; - str = alloca(len + 1); + str = ckmalloc(len + 1); *(char *)mempcpy(str, p, len) = 0; pushstring(str, NULL); + + ckfree(str); } } } @@ -1300,7 +1298,7 @@ str = NULL; savelen = out - (char *)stackblock(); if (savelen > 0) { - str = alloca(savelen); + str = ckmalloc(savelen); memcpy(str, stackblock(), savelen); } if (oldstyle) { @@ -1400,6 +1398,7 @@ if (str) { memcpy(out, str, savelen); STADJUST(savelen, out); + ckfree(str); } USTPUTC(CTLBACKQ, out); if (oldstyle) diff --no-dereference -Naur -- dash.normalized/src/redir.c dash.srctix/src/redir.c --- dash.normalized/src/redir.c 2011-03-10 09:49:46.000000000 +0100 +++ dash.srctix/src/redir.c 2021-02-13 23:06:09.250182482 +0100 @@ -34,7 +34,6 @@ #include #include -#include /* PIPE_BUF */ #include #include #include diff --no-dereference -Naur -- dash.normalized/src/shell.h dash.srctix/src/shell.h --- dash.normalized/src/shell.h 2008-05-02 08:09:44.000000000 +0200 +++ dash.srctix/src/shell.h 2021-02-13 23:06:09.250182482 +0100 @@ -49,8 +49,6 @@ * a quit signal will generate a core dump. */ -#include - #ifndef JOBS #define JOBS 1 #endif diff --no-dereference -Naur -- dash.normalized/tixbuildinfo dash.srctix/tixbuildinfo --- dash.normalized/tixbuildinfo 1970-01-01 01:00:00.000000000 +0100 +++ dash.srctix/tixbuildinfo 2014-03-05 22:44:41.053476982 +0100 @@ -0,0 +1,5 @@ +tix.version=1 +tix.class=srctix +pkg.name=dash +pkg.build-libraries= +pkg.build-system=configure