*** Makefile.orig Mon Mar 7 03:32:46 1994 --- Makefile Wed Aug 20 15:19:15 1997 *************** *** 16,23 **** #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc -g -O ! CFLAGS= LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that --- 16,23 ---- #ADDON=addon.o # Use an ANSI compiler (or at least one that groks prototypes and void *): ! CC=gcc ! CFLAGS= -O2 LDFLAGS= # You may substitute "bison -y" for yacc. (You want to choose the one that *************** *** 28,33 **** --- 28,46 ---- glob.o glom.o hash.o heredoc.o input.o lex.o list.o main.o match.o \ nalloc.o open.o print.o redir.o sigmsgs.o signal.o status.o tree.o \ utils.o var.o version.o wait.o walk.o which.o y.tab.o + + all: rc history + + install: + $(INSTALL) -c rc $(PREFIX)/bin + $(INSTALL) -c history/history $(PREFIX)/bin + for i in - -- -p --p; do rm -f $(PREFIX)/bin/$$i; ln $(PREFIX)/bin/history $(PREFIX)/bin/$$i; done + $(INSTALL) -c rc.1 $(PREFIX)/man/man1 + $(INSTALL) -c history/history.1 $(PREFIX)/man/man1 + strip $(PREFIX)/bin/rc + strip $(PREFIX)/bin/history + gzip -9nf $(PREFIX)/man/man1/rc.1 + gzip -9nf $(PREFIX)/man/man1/history.1 # If rc is compiled with READLINE defined, you must supply the correct # arguments to ld on this line. Typically this would be something like: *** utils.c.orig Wed Aug 20 15:26:52 1997 --- utils.c Wed Aug 20 15:28:11 1997 *************** *** 5,10 **** --- 5,12 ---- #include "rc.h" #include "jbwrap.h" + #include + /* print error with line number on noninteractive shells (i.e., scripts) */ extern void pr_error(char *s) { *************** *** 19,26 **** --- 21,30 ---- /* our perror */ extern void uerror(char *s) { + #if !(defined(BSD) && BSD >= 199306) extern int sys_nerr; extern char *sys_errlist[]; + #endif if (errno > sys_nerr) return; if (s != NULL) --- proto.h 1997/12/19 09:22:28 1.1 +++ proto.h 1997/12/19 09:23:51 @@ -13,6 +13,7 @@ You can override these definitions with compile-line definitions of the same macros. */ +#include #ifndef ALIGN_T typedef long ALIGN_T; @@ -65,7 +66,8 @@ extern int getgroups(int, int *); /*extern int ioctl(int, long,...);*/ /* too much trouble leaving this uncommented */ extern int isatty(int); -#ifndef SYSVR4 /* declares AND defines this in sys/stat.h!! */ +#if !defined(SYSVR4) && !(defined(BSD) && BSD >= 199306) +/* SVR4 declares AND defines this in sys/stat.h!! */ extern int mknod(const char *, int, int); #endif extern int pipe(int *); --- builtins.c.orig Mon Mar 7 03:32:49 1994 +++ builtins.c Tue Feb 24 11:04:28 1998 @@ -466,12 +466,18 @@ #ifndef SYSVR4 extern int getrlimit(int, struct rlimit *); + +/* #ifndef __FreeBSD__ */ +#include +#if !(defined(BSD) && BSD >= 199306) extern int setrlimit(int, struct rlimit *); #endif +#endif + static void printlimit(const Limit *limit, bool hard) { struct rlimit rlim; - long lim; + u_quad_t lim; getrlimit(limit->flag, &rlim); if (hard) lim = rlim.rlim_max; @@ -481,16 +487,19 @@ fprint(1, "%s \tunlimited\n", limit->name); else { const Suffix *suf; + char buf[1024]; for (suf = limit->suffix; suf != NULL; suf = suf->next) if (lim % suf->amount == 0 && (lim != 0 || suf->amount > 1)) { lim /= suf->amount; break; } - fprint(1, "%s \t%d%s\n", limit->name, lim, (suf == NULL || lim == 0) ? "" : suf->name); + (void) snprintf(buf, sizeof(buf), "%s \t%qu%s\n", + limit->name, lim, (suf == NULL || lim == 0) ? "" : suf->name); + fprint(1, "%s", buf); } } -static long parselimit(const Limit *limit, char *s) { +static u_quad_t parselimit(const Limit *limit, char *s) { char *t; int len = strlen(s); long lim = 1;