summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authordavygrvy@pobox.com <davygrvy>2002-02-12 14:22:09 (GMT)
committerdavygrvy@pobox.com <davygrvy>2002-02-12 14:22:09 (GMT)
commite81715002384029bc5cc860ce5afcd153cdb125d (patch)
treee271264a7d2a240921b9f282ebbb0ac8b72c1f73 /unix/tclUnixFile.c
parent6d75d4cc8858f8fff8dc530009e9d27509f02478 (diff)
downloadtcl-e81715002384029bc5cc860ce5afcd153cdb125d.zip
tcl-e81715002384029bc5cc860ce5afcd153cdb125d.tar.gz
tcl-e81715002384029bc5cc860ce5afcd153cdb125d.tar.bz2
* djgpp/ (new directory)
* djgpp/Makefile (new): * unix/tclAppInit.c: * unix/tclMtherr.c: * unix/tclUnixFCmd.c: * unix/tclUnixFile.c: * unix/tclUnixInit.c: * unix/tclUnixPort.h: Early stage of DJGPP support for building Tcl on DOS. Dynamic loading isn't working, yet. Requires watt32 for the TCP/IP stack. No autoconf, yet. Barely tested, but makes a working exe that runs Tcl in protected-mode, flat memory. [exec] and pipes will need the most work as multi-tasking on DOS has to be carefully.
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index fc8fb08..2c1fb87 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFile.c,v 1.16 2002/02/08 02:52:54 dgp Exp $
+ * RCS: @(#) $Id: tclUnixFile.c,v 1.17 2002/02/12 14:26:05 davygrvy Exp $
*/
#include "tclInt.h"
@@ -46,6 +46,7 @@ TclpFindExecutable(argv0)
* (native). */
{
CONST char *name, *p;
+
struct stat statBuf;
int length;
Tcl_DString buffer, nameString;
@@ -135,8 +136,12 @@ TclpFindExecutable(argv0)
* If the name starts with "/" then just copy it to tclExecutableName.
*/
- gotName:
+gotName:
+#ifdef DJGPP
+ if (name[1] == ':') {
+#else
if (name[0] == '/') {
+#endif
Tcl_ExternalToUtfDString(NULL, name, -1, &nameString);
tclNativeExecutableName = (char *)
ckalloc((unsigned) (Tcl_DStringLength(&nameString) + 1));
@@ -168,7 +173,7 @@ TclpFindExecutable(argv0)
Tcl_DStringValue(&nameString));
Tcl_DStringFree(&nameString);
- done:
+done:
Tcl_DStringFree(&buffer);
return tclNativeExecutableName;
}
@@ -645,6 +650,7 @@ TclpReadlink(path, linkPtr)
Tcl_DString *linkPtr; /* Uninitialized or free DString filled
* with contents of link (UTF-8). */
{
+#ifndef DJGPP
char link[MAXPATHLEN];
int length;
CONST char *native;
@@ -660,6 +666,9 @@ TclpReadlink(path, linkPtr)
Tcl_ExternalToUtfDString(NULL, link, length, linkPtr);
return Tcl_DStringValue(linkPtr);
+#else
+ return NULL;
+#endif
}
/*