#include "common.h"
#include "newalloc.h"
+#if defined(_MSC_VER)
#include <io.h>
+#else
+#include <sys/stat.h>
+#endif
+
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
+#include <unistd.h>
+#else
+// No unistd.h in Borland C++
+extern int access (const char *, int);
#define X_OK 1
+#endif
/*!
Call an external program with arguements
// try to find the command in predefined path's
while (ExePathList[i])
{
- cmdLine = (char *) Safe_malloc (strlen (ExePathList[i]) + strlen (cmd) + 10);
+ cmdLine = (char *) Safe_alloc (strlen (ExePathList[i]) + strlen (cmd) + 10);
strcpy (cmdLine, ExePathList[i]); // the path
strcat (cmdLine, DIR_SEPARATOR_STRING);
strcat (cmdLine, cmd + argsStart);
break;
}
- free (cmdLine);
+ Safe_free (cmdLine);
cmdLine = NULL;
i++;
}
{
// command found in predefined path
e = system (cmdLine);
- free (cmdLine);
+ Safe_free (cmdLine);
}
else
{