483475
--- star-1.5/star/checkerr.c.orig-segv	2006-10-31 18:06:25.000000000 +0100
483475
+++ star-1.5/star/checkerr.c	2007-08-27 11:42:39.000000000 +0200
483475
@@ -183,39 +183,45 @@ LOCAL struct eflags {
483475
  */
483475
 LOCAL UInt32_t
483475
 errflags(eflag, doexit)
483475
-	char	*eflag;
483475
-	BOOL	doexit;
483475
+     char	*eflag;
483475
+     BOOL	doexit;
483475
 {
483475
-	register char		*p = eflag;
483475
-		char		*ef = _endword(eflag);
483475
-	register struct eflags	*ep;
483475
-	register int		slen;
483475
-	register UInt32_t	nflags = 0;
483475
-
483475
-	do {
483475
-		for (ep = eflags; ep->fname; ep++) {
483475
-			slen = strlen(ep->fname);
483475
-			if ((strncmp(ep->fname, p, slen) == 0) &&
483475
-			    (p[slen] == '|' || p[slen] == ' ' ||
483475
-			    p[slen] == '\0')) {
483475
-				nflags |= ep->fval;
483475
-				break;
483475
-			}
483475
-		}
483475
-		if (ep->fname == NULL) {
483475
-			if (doexit)
483475
-				comerrno(EX_BAD, "Bad flag '%s'\n", p);
483475
-			return (0);
483475
-		}
483475
-		p = strchr(p, '|');
483475
-	} while (p < ef && p && *p++ == '|');
483475
-
483475
-	if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) {
483475
-		if (doexit)
483475
-			comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag);
483475
-		return (0);
483475
-	}
483475
-	return (nflags);
483475
+  register struct eflags	*ep;
483475
+  register int		slen;
483475
+  register UInt32_t	nflags = 0;
483475
+  char *curflags;
483475
+  char *curflag;
483475
+  
483475
+  curflags = strdup (eflag);
483475
+  *_endword(curflags) = '\0';
483475
+  curflag   = strtok (curflags, "|");
483475
+  
483475
+  while (curflag != NULL) {
483475
+    for (ep = eflags; ep->fname; ep++) {
483475
+      slen = strlen (ep->fname);
483475
+      if ((strncmp (ep->fname, curflag, slen)) == 0) {
483475
+	nflags |= ep->fval;
483475
+	goto next;
483475
+      }
483475
+    }
483475
+    
483475
+    if (doexit)
483475
+      comerrno (EX_BAD, "Bad flag '%s' \n", curflag);
483475
+
483475
+    free (curflags);
483475
+    return (0);
483475
+  next:
483475
+    curflag = strtok (NULL, "|");
483475
+  }
483475
+  
483475
+  free (curflags);
483475
+
483475
+  if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) {
483475
+    if (doexit)
483475
+      comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag);
483475
+    return (0);
483475
+  }
483475
+  return (nflags);
483475
 }
483475
 
483475
 LOCAL ec_t *