Fix file and line number in fileeval messages

This commit is contained in:
Douglas Clowes
2013-08-20 13:58:12 +10:00
parent ac5d894acc
commit 47181a2d58

View File

@@ -512,6 +512,7 @@ int MacroFileEval(SConnection * pCon, SicsInterp * pInter, void *pData,
iRun = 0;
}
if (iChar == (int) '\n') {
iLine++;
pBueffel[i] = (char) iChar;
pBueffel[i + 1] = '\0';
Tcl_DStringAppend(&command, pBueffel, -1);
@@ -520,13 +521,12 @@ int MacroFileEval(SConnection * pCon, SicsInterp * pInter, void *pData,
SetStatus(eEager);
FirstWord(pCom, pBueffel);
if (FindCommand(pInter, pBueffel) != NULL) {
snprintf(pBueffel,sizeof(pBueffel)-1, "%s:%d>> %s", pFile, iLine, pCom);
snprintf(pBueffel,sizeof(pBueffel)-1, "%s:%d>> %s", argv[1], iLine, pCom);
SCWrite(pCon, pBueffel, eLog);
if (pWhere != NULL) {
free(pWhere);
}
pWhere = strdup(pBueffel);
iLine++;
}
iRet = Tcl_Eval(pTcl, pCom);
SetStatus(eBatch);