Overview
| Artifact ID: | ed4393348a78351d7ed026d3b435388da29a4681 |
|---|---|
| Ticket: | 2141271fffffffffffffffffffffffffffffffff |
| Date: | 2008-10-02 05:43:45 |
| User: | yurivict |
| Artifact Attached: | acfbf4d138a8d5edc449dc475790afcf17d48eda |
| Filename: | parse-error.c |
| Description: |
Content:
#include <tcl.h> // for TCL constants only
#include <stdlib.h>
#include <string.h>
int myinit_helper(Tcl_Interp *interp) {
if (Tcl_Init(interp) == TCL_ERROR) {
printf("Error while Tcl_Init\n");
exit(-1);
}
{
int res;
//char *p = "\n set subtxt [util strsep $txt_copy $off \" \t\n.!?,:;\"'`<>(){}[]@#$%^&*+-=/\"]\n";
char *p = "set x \" xxx\"'`xxxxxxx\"\n";
Tcl_Parse parse;
res = Tcl_ParseCommand(interp, p, strlen(p), 0, &parse); // <---- ***** statement that's failing w/out the error message
if (res == TCL_ERROR) {
const char *msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
printf("Tcl_ParseCommand: error: %s\n", msg ? msg : "<null>");
} else {
printf("Tcl_ParseCommand: success\n");
}
}
return TCL_OK;
}
main(int argc, char *argv[]) {
Tcl_Main(argc, argv, &myinit_helper);
}