ref: 9f6a29b667e12288b24d84d3564ee54d33073c0d
parent: eecac7bd6fb4ebaf7ce4352067c0564b1ed5209f
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Feb 5 03:43:31 EST 2014
mothra: better handling of malformed search regex
--- a/sys/src/cmd/mothra/mothra.c
+++ b/sys/src/cmd/mothra/mothra.c
@@ -699,7 +699,10 @@
pldraw(root, screen);
}
-void regerror(char*){} /* don't panic */+void regerror(char *msg)
+{+ werrstr("regerror: %s", msg);+}
void search(void){static char last[256];
@@ -713,10 +716,12 @@
strncpy(buf, last, sizeof(buf)-1);
if(eenter("Search for", buf, sizeof(buf), &mouse) <= 0)return;
- re = regcompnl(buf);
- if(re == nil)
- return;
strncpy(last, buf, sizeof(buf)-1);
+ re = regcompnl(buf);
+ if(re == nil){+ message("%r");+ continue;
+ }
for(tp=current->text;tp;tp=tp->next)
if(tp->flags & PL_SEL)
break;
--
⑨