-# $OpenBSD: Makefile,v 1.11 2013/07/13 16:34:43 miod Exp $
+# $OpenBSD: Makefile,v 1.12 2015/06/17 03:48:21 deraadt Exp $
#
# C Shell with process control; VM/UNIX VAX Makefile
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
PROG= csh
-DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
+DFLAGS=-DBUILTIN -DNLS -DSHORT_STRINGS
#CFLAGS+=-g
#CFLAGS+=-Wall
CFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
-/* $OpenBSD: const.c,v 1.6 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: const.c,v 1.7 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: const.c,v 1.6 1995/03/21 09:02:31 cgd Exp $ */
/*-
Char STRfakecom[] = { '{', ' ', '.', '.', '.', ' ', '}', '\0' };
Char STRfakecom1[] = { '`', ' ', '.', '.', '.', ' ', '`', '\0' };
Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
-#ifdef FILEC
Char STRfilec[] = { 'f', 'i', 'l', 'e', 'c', '\0' };
-#endif /* FILEC */
Char STRhistchars[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' };
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
'y', '\0' };
-/* $OpenBSD: csh.h,v 1.21 2015/02/08 06:01:25 tedu Exp $ */
+/* $OpenBSD: csh.h,v 1.22 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: csh.h,v 1.9 1995/03/21 09:02:40 cgd Exp $ */
/*-
bool timflg; /* Time the next waited for command */
bool havhash; /* path hashing is available */
-#ifdef FILEC
bool filec; /* doing filename expansion */
-#endif
/*
* Global i/o info
-/* $OpenBSD: extern.h,v 1.20 2015/02/08 06:01:25 tedu Exp $ */
+/* $OpenBSD: extern.h,v 1.21 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: extern.h,v 1.8 1996/10/31 23:50:54 christos Exp $ */
/*-
/*
* file.c
*/
-#ifdef FILEC
int tenex(Char *, int);
-#endif
/*
* func.c
void rscan(Char **, void (*)(int));
void tglob(Char **);
void trim(Char **);
-#ifdef FILEC
int sortscmp(const void *, const void *);
-#endif /* FILEC */
/*
* hist.c
-/* $OpenBSD: file.c,v 1.20 2015/06/03 01:49:35 deraadt Exp $ */
+/* $OpenBSD: file.c,v 1.21 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: file.c,v 1.11 1996/11/08 19:34:37 christos Exp $ */
/*-
* SUCH DAMAGE.
*/
-#ifdef FILEC
#include <sys/types.h>
#include <sys/ioctl.h>
return (TRUE);
return (FALSE);
}
-#endif /* FILEC */
-/* $OpenBSD: glob.c,v 1.17 2015/02/08 06:01:25 tedu Exp $ */
+/* $OpenBSD: glob.c,v 1.18 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: glob.c,v 1.10 1995/03/21 09:03:01 cgd Exp $ */
/*-
continue;
}
-#ifdef FILEC
int
sortscmp(const void *a, const void *b)
{
return ((int) Strcmp(*(Char **)a, *(Char **)b));
#endif
}
-#endif /* FILEC */
-/* $OpenBSD: lex.c,v 1.16 2015/02/08 06:09:50 tedu Exp $ */
+/* $OpenBSD: lex.c,v 1.17 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: lex.c,v 1.9 1995/09/27 00:38:46 jtc Exp $ */
/*-
{
int buf, off, c;
-#ifdef FILEC
int numleft = 0, roomleft;
Char ttyline[BUFSIZ];
-#endif
char tbuf[BUFSIZ + 1];
if (cantell) {
off = (int) feobp % BUFSIZ;
roomleft = BUFSIZ - off;
-#ifdef FILEC
roomleft = BUFSIZ - off;
for (;;) {
if (filec && intty) {
numleft = 0;
}
else {
-#endif
c = read(SHIN, tbuf, roomleft);
if (c > 0) {
int i;
for (i = 0; i < c; i++)
ptr[i] = (unsigned char) tbuf[i];
}
-#ifdef FILEC
}
-#endif
if (c >= 0)
break;
if (errno == EWOULDBLOCK) {
if (c <= 0)
return (-1);
feobp += c;
-#ifndef FILEC
- goto again;
-#else
if (filec && !intty)
goto again;
-#endif
}
c = fbuf[buf][(int) fseekp % BUFSIZ];
fseekp++;
-/* $OpenBSD: set.c,v 1.14 2015/02/08 05:47:28 tedu Exp $ */
+/* $OpenBSD: set.c,v 1.15 2015/06/17 03:48:21 deraadt Exp $ */
/* $NetBSD: set.c,v 1.8 1995/03/21 18:35:52 mycroft Exp $ */
/*-
dtilde();
xfree(cp);
}
-#ifdef FILEC
else if (eq(vp, STRfilec))
filec = 1;
-#endif
} while ((p = *v++) != NULL);
}
unset(Char **v, struct command *t)
{
unset1(v, &shvhed);
-#ifdef FILEC
if (adrof(STRfilec) == 0)
filec = 0;
-#endif
if (adrof(STRhistchars) == 0) {
HIST = '!';
HISTSUB = '^';