scsh-users
[Top] [All Lists]

Patch for scsh regexp bug

To: scsh-users@scsh.net
Subject: Patch for scsh regexp bug
From: "Matthew R. Dempsky" <mrd@alkemio.org>
Date: Mon, 23 Oct 2006 16:51:52 -0500
List-id: <scsh-users.list-id.scsh.net>
I noticed that in posix_compile_regexp, scsh doesn't properly compute
the flags argument to pass to regcomp (``|'' has higher precedence
than ``?:'').

(Unfortunately, this is unrelated to the ``invalid character set''
error from before.)

--- regexp1.c~  Mon Oct 23 16:29:43 2006
+++ regexp1.c   Mon Oct 23 16:29:43 2006
@@ -66,10 +66,10 @@
   s48_value sch_regex;
   int status;
   S48_DECLARE_GC_PROTECT(1);
-  int flags = S48_EXTRACT_BOOLEAN(extended_p)    ? REG_EXTENDED : 0 |
-              S48_EXTRACT_BOOLEAN(ignore_case_p) ? REG_ICASE    : 0 |
-              S48_EXTRACT_BOOLEAN(submatches_p)  ? 0 : REG_NOSUB |
-              S48_EXTRACT_BOOLEAN(newline_p)     ? REG_NEWLINE  : 0;
+  int flags = (S48_EXTRACT_BOOLEAN(extended_p)    ? REG_EXTENDED : 0) |
+              (S48_EXTRACT_BOOLEAN(ignore_case_p) ? REG_ICASE    : 0) |
+              (S48_EXTRACT_BOOLEAN(submatches_p)  ? 0 : REG_NOSUB) |
+              (S48_EXTRACT_BOOLEAN(newline_p)     ? REG_NEWLINE  : 0);
 
   S48_GC_PROTECT_1(pattern);
 

<Prev in Thread] Current Thread [Next in Thread>