From: nishi Date: Wed, 22 May 2024 23:23:32 +0000 (+0000) Subject: watcom does not like goto X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=90630f97f4b012bd621894e66fdeef57fbc4dee6;p=dataworks.git watcom does not like goto git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@83 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Client/main.c b/Client/main.c index bc82cde..c7bcdf0 100644 --- a/Client/main.c +++ b/Client/main.c @@ -216,32 +216,34 @@ int main(int argc, char** argv) { linebuf = __dw_strcat(tmp, buf); free(tmp); int i; -rep:; - for(i = 0; linebuf[i] != 0; i++){ - if(linebuf[i] == ';'){ - char* line = malloc(i + 1); - line[i] = 0; - memcpy(line, linebuf, i); - struct __dw_token* token = __dw_parser_parse(NULL, line); - if(token != NULL) { - if(token->error) { - printf("%s\n", dataworks_database_strerror(token->errnum)); + while(true){ + for(i = 0; linebuf[i] != 0; i++){ + if(linebuf[i] == ';'){ + char* line = malloc(i + 1); + line[i] = 0; + memcpy(line, linebuf, i); + struct __dw_token* token = __dw_parser_parse(NULL, line); + if(token != NULL) { + if(token->error) { + printf("%s\n", dataworks_database_strerror(token->errnum)); + } else { + } } else { + printf("Parser returned NULL. Help!\n"); } - } else { - printf("Parser returned NULL. Help!\n"); - } - if(fprog != NULL){ - printf("%s\n", line); + if(fprog != NULL){ + printf("%s\n", line); + } + free(line); + char* newbuf = malloc(strlen(linebuf) - i); + newbuf[strlen(linebuf) - i - 1] = 0; + memcpy(newbuf, linebuf + i + 1, strlen(linebuf) - i - 1); + free(linebuf); + linebuf = newbuf; + continue; } - free(line); - char* newbuf = malloc(strlen(linebuf) - i); - newbuf[strlen(linebuf) - i - 1] = 0; - memcpy(newbuf, linebuf + i + 1, strlen(linebuf) - i - 1); - free(linebuf); - linebuf = newbuf; - goto rep; } + break; } } if(fprog == NULL){