Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31557
Modified Files:
mal_debugger.mx mal_module.mx
Log Message:
Simplify patterns and avoid a segfault on illegal input.
Index: mal_debugger.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_debugger.mx,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- mal_debugger.mx 28 Aug 2007 07:46:59 -0000 1.206
+++ mal_debugger.mx 28 Aug 2007 11:47:24 -0000 1.207
@@ -1347,7 +1347,7 @@
continue;
}
case '?':
- if( b[1]){
+ if( !isspace((int)b[1])){
showHelp(cntxt->nspace,b+1,out);
continue;
}
Index: mal_module.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_module.mx,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- mal_module.mx 25 Aug 2007 07:46:00 -0000 1.55
+++ mal_module.mx 28 Aug 2007 11:47:24 -0000 1.56
@@ -777,6 +777,7 @@
}
@-
Some primitives to aid online help and completions.
+Note that pattern matching is on string prefix.
@c
int tstDuplicate(char **msg, char *s){
int i;
@@ -812,16 +813,24 @@
if( t) { doc++; *t=0; completion=0; }
t= strchr(pat,'(');
if( t) { sig++; *t=0; completion=0; }
+
+ /* rudimentary patterns only.
+ *.nme nme.* nme.nme *.*
+ ignore the rest.
+ */
modnme= pat;
if( (fcnnme = strchr(pat,'.')) ){
*fcnnme++ = 0;
+ if( strchr(modnme,'*'))
+ modnme="*";
+ if( strchr(fcnnme,'*'))
+ fcnnme="*";
+ } else {
+ modnme="*";
+ fcnnme=pat;
+ if( strchr(fcnnme,'*'))
+ fcnnme="*";
}
- t = modnme;
- while((isalpha((int) *t) || *t == '_' || *t=='*') && *t) t++;
- if(t) *t = 0;
- t = fcnnme;
- while(t && (isalpha((int) *t) || *t == '_' || *t=='*') && *t) t++;
- if(t) *t = 0;
if( fcnnme){
len2 = strlen(fcnnme);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins