GNU bug report logs - #16729
suggested small refactoring in dfa.c

Previous Next

Package: grep;

Reported by: arnold <at> skeeve.com

Date: Wed, 12 Feb 2014 14:00:03 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16729 in the body.
You can then email your comments to 16729 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#16729; Package grep. (Wed, 12 Feb 2014 14:00:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to arnold <at> skeeve.com:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Wed, 12 Feb 2014 14:00:11 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: arnold <at> skeeve.com
To: bug-grep <at> gnu.org
Subject: suggested small refactoring in dfa.c
Date: Wed, 12 Feb 2014 06:58:53 -0700
Hi Jim, Paul.

Here is the small refactoring I suggest for dfa.c

Thanks,

Arnold
--------------------
diff --git a/dfa.c b/dfa.c
index d5e7fdf..dcd28e5 100644
--- a/dfa.c
+++ b/dfa.c
@@ -1767,18 +1767,19 @@ add_utf8_anychar (void)
 static void
 atom (void)
 {
-  if (0)
+  if (MBS_SUPPORT && tok == WCHAR)
     {
-      /* empty */
-    }
-  else if (MBS_SUPPORT && tok == WCHAR)
-    {
-      addtok_wc (case_fold ? towlower (wctok) : wctok);
-      if (case_fold && iswalpha (wctok))
-        {
-          addtok_wc (towupper (wctok));
-          addtok (OR);
-        }
+      if (! case_fold)
+        addtok_wc (wctok);
+      else
+      {
+        addtok_wc (towlower (wctok));
+        if (iswalpha (wctok))
+          {
+            addtok_wc (towupper (wctok));
+            addtok (OR);
+          }
+      }
 
       tok = lex ();
     }




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 01 Mar 2014 06:57:03 GMT) Full text and rfc822 format available.

Notification sent to arnold <at> skeeve.com:
bug acknowledged by developer. (Sat, 01 Mar 2014 06:57:04 GMT) Full text and rfc822 format available.

Message #10 received at 16729-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 16729-done <at> debbugs.gnu.org
Subject: Re:  suggested small refactoring in dfa.c
Date: Fri, 28 Feb 2014 22:56:49 -0800
My recent changes to dfa.c have incorporated the removal of that "if 
(0)" and have refactored the rest so I'm marking this bug as done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 Mar 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.