From 9f2d599db2cff6ee2a1733e43966eb5aeebdd35e Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 27 Feb 2006 21:38:22 +0000 Subject: [PATCH] fix parser.c .h for standard XML git-svn-id: http://ltt.polymtl.ca/svn@1558 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/configure.in | 2 +- ltt/branches/poly/ltt/parser.c | 54 ++++++++++++++++++++++++++++------ ltt/branches/poly/ltt/parser.h | 3 +- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index c226b39a..4b819f48 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.21-22022006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.22-27022006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index 2d8c9c4a..bcae82e1 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -97,11 +97,26 @@ int getSizeindex(unsigned int value) unsigned long long int getSize(parse_file_t *in) { char *token; + int has_quotes = 0; + unsigned long long int ret; token = getToken(in); + if(token[0] == '"') { + has_quotes = 1; + token = getToken(in); + } if(in->type == NUMBER) { - return strtoull(token, NULL, 0); - } + ret = strtoull(token, NULL, 0); + } else { + goto error; + } + if(has_quotes) { + token = getToken(in); + if(token[0] != '"') goto error; + } + + return ret; +error: in->error(in,"incorrect size specification"); return -1; } @@ -360,21 +375,40 @@ char *getNameAttribute(parse_file_t *in) //for