Fix file and line number in fileeval messages
This commit is contained in:
4
macro.c
4
macro.c
@@ -512,6 +512,7 @@ int MacroFileEval(SConnection * pCon, SicsInterp * pInter, void *pData,
|
|||||||
iRun = 0;
|
iRun = 0;
|
||||||
}
|
}
|
||||||
if (iChar == (int) '\n') {
|
if (iChar == (int) '\n') {
|
||||||
|
iLine++;
|
||||||
pBueffel[i] = (char) iChar;
|
pBueffel[i] = (char) iChar;
|
||||||
pBueffel[i + 1] = '\0';
|
pBueffel[i + 1] = '\0';
|
||||||
Tcl_DStringAppend(&command, pBueffel, -1);
|
Tcl_DStringAppend(&command, pBueffel, -1);
|
||||||
@@ -520,13 +521,12 @@ int MacroFileEval(SConnection * pCon, SicsInterp * pInter, void *pData,
|
|||||||
SetStatus(eEager);
|
SetStatus(eEager);
|
||||||
FirstWord(pCom, pBueffel);
|
FirstWord(pCom, pBueffel);
|
||||||
if (FindCommand(pInter, pBueffel) != NULL) {
|
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);
|
SCWrite(pCon, pBueffel, eLog);
|
||||||
if (pWhere != NULL) {
|
if (pWhere != NULL) {
|
||||||
free(pWhere);
|
free(pWhere);
|
||||||
}
|
}
|
||||||
pWhere = strdup(pBueffel);
|
pWhere = strdup(pBueffel);
|
||||||
iLine++;
|
|
||||||
}
|
}
|
||||||
iRet = Tcl_Eval(pTcl, pCom);
|
iRet = Tcl_Eval(pTcl, pCom);
|
||||||
SetStatus(eBatch);
|
SetStatus(eBatch);
|
||||||
|
|||||||
Reference in New Issue
Block a user