From fc4556e2d09f578a369fabe20bffc8686c2adce0 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 6 Sep 2016 14:50:26 +0200 Subject: [PATCH] fix for vxWorks --- runScript.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runScript.c b/runScript.c index 1ac8b27..9fc58d3 100644 --- a/runScript.c +++ b/runScript.c @@ -236,12 +236,13 @@ int runScript(const char* filename, const char* args) if (end) dirlen = (int)(end++ - dirname); else dirlen = (int)strlen(dirname); if (dirlen == 0) continue; /* ignore empty path elements */ + if (dirname[dirlen-1] == OSI_PATH_SEPARATOR[0]) dirlen--; asprintf(&fullname, "%.*s" OSI_PATH_SEPARATOR "%s", dirlen, dirname, filename); if (runScriptDebug) printf("runScript: trying %s\n", fullname); file = fopen(fullname, "r"); - if (!file && errno != ENOENT) perror(fullname); + if (!file && (errno & 0xffff) != ENOENT) perror(fullname); free(fullname); if (file) break; }