tcledit: Fix some error reporting

This commit is contained in:
Gregory Nutt 2016-11-12 08:19:39 -06:00
parent 104d743c2a
commit 047a51c592
2 changed files with 13 additions and 3 deletions

View File

@ -3,6 +3,7 @@
/.depend
/.built
/tcledit
/tcledit.exe
/*.asm
/*.rel
/*.lst

View File

@ -757,9 +757,18 @@ int Tcl_AppInit(Tcl_Interp *interp)
ret = Tcl_EvalFile(g_tcledit_interp, g_tcledit_path);
if (ret != TCL_OK)
{
fprintf(stderr, "Tcl_EvalFile failed: %d\n", ret);
fprintf(stderr, " %s\n", Tcl_GetVar(g_tcledit_interp, "errorCode", 0));
fprintf(stderr, " %s\n", Tcl_GetVar(g_tcledit_interp, "errorInfo", 0));
Tcl_Obj *result;
char *ptr;
fprintf(stderr, "Tcl_EvalFile failed (%d): ", ret);
result = Tcl_GetObjResult(g_tcledit_interp);
for (i = 0, ptr = result->bytes; i < result->length; i++, ptr++)
{
fputc(*ptr, stderr);
}
fputc('\n', stderr);
exit(1);
}