summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/tw.color.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-04-20 04:22:36 +0000
committerobrien <obrien@FreeBSD.org>2000-04-20 04:22:36 +0000
commitefebb8d2fa02976f24760fdc8c7444d9cbfc1ca3 (patch)
treeb621d4cee9510d59a22e8ba84f80bd04ed79bd74 /contrib/tcsh/tw.color.c
parent4ad28cefef28ce6bdb44a0532cfe20a2076bc694 (diff)
downloadFreeBSD-src-efebb8d2fa02976f24760fdc8c7444d9cbfc1ca3.zip
FreeBSD-src-efebb8d2fa02976f24760fdc8c7444d9cbfc1ca3.tar.gz
6.09.01 vendor update.
Diffstat (limited to 'contrib/tcsh/tw.color.c')
-rw-r--r--contrib/tcsh/tw.color.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/tcsh/tw.color.c b/contrib/tcsh/tw.color.c
index a252a8d..dd34e6f 100644
--- a/contrib/tcsh/tw.color.c
+++ b/contrib/tcsh/tw.color.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/tw.color.c,v 1.5 1998/10/25 15:10:48 christos Exp $ */
+/* $Header: /src/pub/tcsh/tw.color.c,v 1.6 2000/01/14 22:57:30 christos Exp $ */
/*
* tw.color.c: builtin color ls-F
*/
@@ -36,7 +36,7 @@
*/
#include "sh.h"
-RCSID("$Id: tw.color.c,v 1.5 1998/10/25 15:10:48 christos Exp $")
+RCSID("$Id: tw.color.c,v 1.6 2000/01/14 22:57:30 christos Exp $")
#include "tw.h"
#include "ed.h"
@@ -181,6 +181,7 @@ parseLS_COLORS(value)
const Char *v; /* pointer in value */
char *c; /* pointer in colors */
Extension *e; /* pointer in extensions */
+ jmp_buf_t osetexit;
/* init */
if (extensions)
@@ -209,6 +210,12 @@ parseLS_COLORS(value)
c = colors;
e = &extensions[0];
+ /* Prevent from crashing if unknown parameters are given. */
+
+ getexit(osetexit);
+
+ if (setexit() == 0) {
+
/* parse */
while (*v) {
switch (*v & CHAR) {
@@ -246,6 +253,9 @@ parseLS_COLORS(value)
while (*v && (*v & CHAR) != ':')
v++;
}
+ }
+
+ resexit(osetexit);
nextensions = (int) (e - extensions);
}
OpenPOWER on IntegriCloud