]> git.wh0rd.org Git - nano.git/commitdiff
in edit_draw(), don't display any statusbar message when we get a
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 21 Jun 2006 20:51:36 +0000 (20:51 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 21 Jun 2006 20:51:36 +0000 (20:51 +0000)
zero-length regex, as we can get one under legitimate circumstances

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3677 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/winio.c

index a4d2bad102acd962657bcd62feb838a689e80376..cfe4a23240b747ec495e3b8bdea4f596a1a2e046 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -420,6 +420,9 @@ CVS code -
          well as single-line ones.  This avoids a segfault when trying
          to color e.g. "start="$" end="$"". (DLR, found by Trevor
          Caira)
+       - Don't display any statusbar message when we get a zero-length
+         regex, as we can get one under legitimate circumstances. (DLR,
+         found by Mike Frysinger)
   update_line()
        - Remove unneeded assert. (DLR)
   edit_redraw()
index 0cee05bb1c6eeb04519f5f872a9b2ef4624f4150..4fba6de274aa6153c588a98495ea3f42891a2a9b 100644 (file)
@@ -2357,11 +2357,11 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
                     * line. */
                    startmatch.rm_so += k;
                    startmatch.rm_eo += k;
-                   if (startmatch.rm_so == startmatch.rm_eo) {
+
+                   /* Skip over a zero-length regex match. */
+                   if (startmatch.rm_so == startmatch.rm_eo)
                        startmatch.rm_eo++;
-                       statusbar(
-                               _("Refusing zero-length regex match"));
-                   } else if (startmatch.rm_so < endpos &&
+                   else if (startmatch.rm_so < endpos &&
                        startmatch.rm_eo > startpos) {
                        x_start = (startmatch.rm_so <= startpos) ? 0 :
                                strnlenpt(fileptr->data,
@@ -2408,10 +2408,11 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
                        goto step_two;
                    start_line = start_line->prev;
                }
-               if (startmatch.rm_so == startmatch.rm_eo) {
+
+               /* Skip over a zero-length regex match. */
+               if (startmatch.rm_so == startmatch.rm_eo)
                    startmatch.rm_eo++;
-                   statusbar(_("Refusing zero-length regex match"));
-               } else {
+               else {
                    /* No start found, so skip to the next step. */
                    if (start_line == NULL)
                        goto step_two;