summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-20 17:06:30 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-20 17:06:30 +0000
commitdbd6cede000d76a4da64732989ebc219a3e7d612 (patch)
treeb90d4353fc9ba3f6f4eaa4ae95365666404067ef
parent6c0553c8c504d4c6da20857abeec80648d841b72 (diff)
downloadopenocd+libswd-dbd6cede000d76a4da64732989ebc219a3e7d612.tar.gz
openocd+libswd-dbd6cede000d76a4da64732989ebc219a3e7d612.tar.bz2
openocd+libswd-dbd6cede000d76a4da64732989ebc219a3e7d612.tar.xz
openocd+libswd-dbd6cede000d76a4da64732989ebc219a3e7d612.zip
Duane Ellis <openocd@duaneellis.com>
improve error message in Jim when sourcing a file fails. Previously it did not tell you the CWD Jim was using as its reference point. (Helpful when script filenames are a relative path) git-svn-id: svn://svn.berlios.de/openocd/trunk@840 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/helper/jim.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/helper/jim.c b/src/helper/jim.c
index c1434dbb..32eb6759 100644
--- a/src/helper/jim.c
+++ b/src/helper/jim.c
@@ -8734,12 +8734,15 @@ int Jim_EvalFile(Jim_Interp *interp, const char *filename)
int nread, totread, maxlen, buflen;
int retval;
Jim_Obj *scriptObjPtr;
+ char cwd[ 2048 ];
if ((fp = fopen(filename, "r")) == NULL) {
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
+ getcwd( cwd, sizeof(cwd) );
Jim_AppendStrings(interp, Jim_GetResult(interp),
- "Error loading script \"", filename, "\": ",
- strerror(errno), NULL);
+ "Error loading script \"", filename, "\"",
+ " cwd: ", cwd,
+ " err: ", strerror(errno), NULL);
return JIM_ERR;
}
buflen = 1024;