*** vte.c.orig	Wed Jul  9 14:15:44 2003
--- vte.c	Wed Jul  9 14:36:24 2003
***************
*** 1632,1642 ****
  		 * matches, so we'll have to skip each match until we
  		 * stop getting matches. */
  		coffset = 0;
! 		ret = regexec(&regex->reg,
  			      terminal->pvt->match_contents + coffset,
  			      G_N_ELEMENTS(matches),
  			      matches,
  			      VTE_REGEXEC_FLAGS);
  		while (ret == 0) {
  			for (j = 0;
  			     (j < G_N_ELEMENTS(matches)) &&
--- 1632,1646 ----
  		 * matches, so we'll have to skip each match until we
  		 * stop getting matches. */
  		coffset = 0;
!                 if (strlen(&regex->reg) != 0) {
!                     ret = regexec(&regex->reg,
  			      terminal->pvt->match_contents + coffset,
  			      G_N_ELEMENTS(matches),
  			      matches,
  			      VTE_REGEXEC_FLAGS);
+                 } else {
+                     ret = REG_NOMATCH;
+                 }
  		while (ret == 0) {
  			for (j = 0;
  			     (j < G_N_ELEMENTS(matches)) &&
***************
*** 1704,1714 ****
  			/* Skip past the beginning of this match to
  			 * look for more. */
  			coffset += (matches[0].rm_so + 1);
! 			ret = regexec(&regex->reg,
  				      terminal->pvt->match_contents + coffset,
  				      G_N_ELEMENTS(matches),
  				      matches,
  				      VTE_REGEXEC_FLAGS);
  		}
  	}
  	terminal->pvt->match_previous = -1;
--- 1708,1722 ----
  			/* Skip past the beginning of this match to
  			 * look for more. */
  			coffset += (matches[0].rm_so + 1);
! 			if (strlen(&regex->reg != 0)) {
!                             ret = regexec(&regex->reg,
  				      terminal->pvt->match_contents + coffset,
  				      G_N_ELEMENTS(matches),
  				      matches,
  				      VTE_REGEXEC_FLAGS);
+                         } else {
+                             ret = REG_NOMATCH;
+                         }
  		}
  	}
  	terminal->pvt->match_previous = -1;
