Changeset: af89dd99fe60 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=af89dd99fe60
Modified Files:
clients/mapiclient/eventparser.c
clients/mapiclient/eventparser.h
Branch: mosaic
Log Message:
Merge with default
diffs (93 lines):
diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -6,7 +6,7 @@
* Copyright 2008-2015 MonetDB B.V.
*/
-/* (c) M Kersten, S Manegold */
+/* (c) M Kersten */
#include "eventparser.h"
@@ -212,7 +212,7 @@ parseArguments(char *call, int m)
int
eventparser(char *row, EventRecord *ev)
{
- char *c, *cc, *v =0;
+ char *c, *cc, *v =0,*w;
struct tm stm;
malargc = 0;
@@ -340,8 +340,8 @@ eventparser(char *row, EventRecord *ev)
if (*c == 0)
return -1;
*c = 0;
- ev->numa= strdup(numa);
- if( ev->num == NULL){
+ ev->numa = strdup(numa);
+ if( ev->numa == NULL){
fprintf(stderr,"Could not allocate numa memory\n");
exit(-1);
}
@@ -394,13 +394,6 @@ eventparser(char *row, EventRecord *ev)
exit(-1);
}
c= ev->fcn;
- if( ev->state == MDB_SYSTEM){
- monetdb_characteristics = strdup(ev->stmt);
- if( ev->stmt == NULL){
- fprintf(stderr,"Could not allocate
monetdb_characteristics memory\n");
- exit(-1);
- }
- } else
if( *c != '[')
{
v=c;
@@ -433,14 +426,25 @@ eventparser(char *row, EventRecord *ev)
if( v)
parseArguments(v+3,1);
}
- if (ev->stmt && (v=strstr(ev->stmt, ",\t]"))){
- *v=',';
- *(v+1) = 0;
- } else
- if (ev->stmt && (v=strstr(ev->stmt, "\"\t]")))
- *v = 0;
- else
- if (ev->stmt && (v=strstr(ev->stmt, "\t]")))
- *v = 0;
+ // remove some superflous elements
+ w = strrchr(ev->stmt, (int) ']');
+ if(w && *w == ev->stmt[strlen(ev->stmt)-1])
+ *w = 0;
+ w = strrchr(ev->stmt, (int) '\t');
+ if(w && *w == ev->stmt[strlen(ev->stmt)-1])
+ *w = 0;
+ w = strrchr(ev->stmt, (int) ',');
+ if(w && *w == ev->stmt[strlen(ev->stmt)-1])
+ *w = 0;
+ w = strrchr(ev->stmt, (int) '"');
+ if(w && *w == ev->stmt[strlen(ev->stmt)-1])
+ *w = 0;
+ if( ev->state == MDB_SYSTEM){
+ monetdb_characteristics = strdup(ev->stmt);
+ if( monetdb_characteristics == NULL){
+ fprintf(stderr,"Could not allocate
monetdb_characteristics memory\n");
+ exit(-1);
+ }
+ }
return 0;
}
diff --git a/clients/mapiclient/eventparser.h b/clients/mapiclient/eventparser.h
--- a/clients/mapiclient/eventparser.h
+++ b/clients/mapiclient/eventparser.h
@@ -6,7 +6,7 @@
* Copyright 2008-2015 MonetDB B.V.
*/
-/* (c) M Kersten, S Manegold
+/* (c) M Kersten
* The easiest calling method is something like:
* tomograph -d demo --atlast=10
* which connects to the demo database server and
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list