diff options
author | davygrvy <davygrvy@noemail.net> | 2002-02-12 14:22:09 (GMT) |
---|---|---|
committer | davygrvy <davygrvy@noemail.net> | 2002-02-12 14:22:09 (GMT) |
commit | fe72b3a5e08db49bbe2a8ad57ae6337ecaf5b100 (patch) | |
tree | e271264a7d2a240921b9f282ebbb0ac8b72c1f73 /unix/tclUnixFile.c | |
parent | 5fffbb4dce11539b7de8fdfcc4b834f995d9abb7 (diff) | |
download | tcl-fe72b3a5e08db49bbe2a8ad57ae6337ecaf5b100.zip tcl-fe72b3a5e08db49bbe2a8ad57ae6337ecaf5b100.tar.gz tcl-fe72b3a5e08db49bbe2a8ad57ae6337ecaf5b100.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.
FossilOrigin-Name: 58a026b69c9d29a1332cd0f3a87386fdcf5f240f
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 15 |
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 } /* |