Skip to content

Commit

Permalink
Fixing pdksh build process
Browse files Browse the repository at this point in the history
This won't solve the actual bug

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
  • Loading branch information
Álvaro Jurado committed Jan 27, 2017
1 parent 9851bc8 commit 0bd709e
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cmd/pdksh/Makefile
Expand Up @@ -13,7 +13,7 @@ all: $(TARGET) clean
$(CC) $(CFLAGS) -c $(SRCS)

$(TARGET): $(OBJ)
$(LD) --verbose -nostdlib -o $(TARGET) $(APEXLIB)/crt1.o $(APEXLIB)/crti.o $(APEXLIB)/crtn.o $(OBJ) -L$(APEXLIB) -L$(HARVEYLIB) -lap -lc
$(LD) -nostdlib -o $(TARGET) $(APEXLIB)/crt1.o $(APEXLIB)/crti.o $(APEXLIB)/crtn.o $(OBJ) -L$(APEXLIB) -L$(HARVEYLIB) -lap -lc

clean:
rm -f $(OBJ)
12 changes: 6 additions & 6 deletions cmd/pdksh/c_ksh.c
Expand Up @@ -567,7 +567,7 @@ c_whence(wp)
break;
}
if (vflag || !ret)
shprintf(newline);
shprintf("%s", newline);
}
return ret;
}
Expand Down Expand Up @@ -867,7 +867,7 @@ c_typeset(wp)
else
print_value_quoted(s);
}
shprintf(newline);
shprintf("%s", newline);
}
/* Only report first `element' of an array with
* no set elements.
Expand Down Expand Up @@ -958,7 +958,7 @@ c_alias(wp)
shf_putc('=', shl_stdout);
print_value_quoted(ap->val.s);
}
shprintf(newline);
shprintf("%s", newline);
}
}

Expand All @@ -982,7 +982,7 @@ c_alias(wp)
shf_putc('=', shl_stdout);
print_value_quoted(ap->val.s);
}
shprintf(newline);
shprintf("%s", newline);
} else {
shprintf("%s alias not found\n", alias);
rv = 1;
Expand Down Expand Up @@ -1227,7 +1227,7 @@ c_kill(wp)
"Usage: kill [ -s signame | -signum | -signame ] {pid|job}...\n\
kill -l [exit_status]\n"
);
bi_errorf(null);
bi_errorf("%s", null);
return 1;
}

Expand All @@ -1248,7 +1248,7 @@ c_kill(wp)
for (i = 1; i < SIGNALS; i++, p = space)
if (sigtraps[i].name)
shprintf("%s%s", p, sigtraps[i].name);
shprintf(newline);
shprintf("%s", newline);
} else {
int w, i;
int mess_width;
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdksh/exec.c
Expand Up @@ -153,7 +153,7 @@ execute(t, flags)
*/
if (tp && tp->type == CSHELL
&& (tp->flag & SPEC_BI))
errorf(null);
errorf("%s", null);
/* Deal with FERREXIT, quitenv(), etc. */
goto Break;
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdksh/expr.c
Expand Up @@ -194,7 +194,7 @@ v_evaluate(vp, expr, error_ok)
if (i == LAEXPR) {
if (error_ok == KSH_RETURN_ERROR)
return 0;
errorf(null);
errorf("%s", null);
}
unwind(i);
/*NOTREACHED*/
Expand Down
2 changes: 2 additions & 0 deletions cmd/pdksh/jobs.c
Expand Up @@ -1211,7 +1211,9 @@ j_waitj(j, flags, where)
j->flags &= ~(JF_WAITING|JF_W_ASYNCNOTIFY);

if (j->flags & JF_FG) {
#ifdef JOBS
WAIT_T status;
#endif

j->flags &= ~JF_FG;
#ifdef TTY_PGRP
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdksh/lex.c
Expand Up @@ -865,7 +865,7 @@ yyerror(fmt, va_alist)
SH_VA_START(va, fmt);
shf_vfprintf(shl_out, fmt, va);
va_end(va);
errorf(null);
errorf("%s", null);
}

/*
Expand Down
7 changes: 3 additions & 4 deletions cmd/pdksh/main.c
Expand Up @@ -554,7 +554,7 @@ shell(s, toplevel)
case LSHELL:
if (interactive) {
if (i == LINTR)
shellf(newline);
shellf("%s", newline);
/* Reset any eof that was read as part of a
* multiline command.
*/
Expand Down Expand Up @@ -833,13 +833,12 @@ static int
is_restricted(name)
char *name;
{
char *p;

/* this silly function prevents you running a command called runconf.sh. */
/* we don't care about restricted shells, which aren't very restricted anyway */
/* and introduce a false sense of security */
return 0;
#ifdef dumbidea
char *p;
if ((p = ksh_strrchr_dirsep(name)))
name = p;
/* accepts rsh, rksh, rpdksh, pdrksh, etc. */
Expand All @@ -853,6 +852,6 @@ aerror(ap, msg)
const char *msg;
{
internal_errorf(1, "alloc: %s", msg);
errorf(null); /* this is never executed - keeps gcc quiet */
errorf("%s", null); /* this is never executed - keeps gcc quiet */
/*NOTREACHED*/
}
8 changes: 4 additions & 4 deletions cmd/pdksh/misc.c
Expand Up @@ -245,7 +245,7 @@ printoptions(verbose)
for (i = 0; i < NELEM(options); i++)
if (Flag(i) && options[i].name)
shprintf(" -o %s", options[i].name);
shprintf(newline);
shprintf("%s", newline);
}
}

Expand Down Expand Up @@ -962,7 +962,7 @@ ksh_getopt(argv, go, options)
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)
bi_errorf(null);
bi_errorf("%s", null);
}
return '?';
}
Expand All @@ -988,7 +988,7 @@ ksh_getopt(argv, go, options)
(go->flags & GF_NONAME) ? "" : argv[0],
(go->flags & GF_NONAME) ? "" : ": ", c);
if (go->flags & GF_ERROR)
bi_errorf(null);
bi_errorf("%s", null);
return '?';
}
go->p = 0;
Expand Down Expand Up @@ -1039,7 +1039,7 @@ print_value_quoted(s)
}
for (p = s; *p; p++) {
if (*p == '\'') {
shprintf("'\\'" + 1 - inquote);
shprintf("%s", "'\\'" + 1 - inquote);
inquote = 0;
} else {
if (!inquote) {
Expand Down
1 change: 1 addition & 0 deletions cmd/pdksh/sh.h
Expand Up @@ -25,6 +25,7 @@
/* Start of common headers */

#include <stdio.h>
#include <strings.h>
#include <sys/types.h>
#include <setjmp.h>
#ifdef HAVE_STDDEF_H
Expand Down
4 changes: 2 additions & 2 deletions cmd/pdksh/trap.c
Expand Up @@ -66,7 +66,7 @@ inittraps()
Sigact_ign.sa_flags = KSH_SA_FLAGS;
Sigact_ign.sa_handler = SIG_IGN;
Sigact_trap = Sigact_ign;
Sigact_trap.sa_handler = trapsig;
Sigact_trap.sa_handler = (void *)trapsig;

sigtraps[SIGINT].flags |= TF_DFL_INTR | TF_TTY_INTR;
sigtraps[SIGQUIT].flags |= TF_DFL_INTR | TF_TTY_INTR;
Expand Down Expand Up @@ -427,7 +427,7 @@ setsig(p, f, flags)
p->cursig = f;
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = KSH_SA_FLAGS;
sigact.sa_handler = f;
sigact.sa_handler = (void *)f;
sigaction(p->signal, &sigact, (struct sigaction *) 0);
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/pdksh/var.c
Expand Up @@ -362,7 +362,7 @@ setstr(vq, s, error_ok)
if (vq->flag & RDONLY) {
warningf(TRUE, "%s: is read only", vq->name);
if (!error_ok)
errorf(null);
errorf("%s", null);
return 0;
}
if (!(vq->flag&INTEGER)) { /* string dest */
Expand Down Expand Up @@ -715,7 +715,7 @@ typeset(var, set, clr, field, base)
}
}
if (!ok)
errorf(null);
errorf("%s", null);
}

if (val != NULL) {
Expand Down

0 comments on commit 0bd709e

Please sign in to comment.