summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authordas <das>2002-06-05 11:59:18 (GMT)
committerdas <das>2002-06-05 11:59:18 (GMT)
commit24229b74b75e8ef219e5f08228243037b6ee7131 (patch)
treee1fd79f317196368a93f0b09f69169f56c39fc49 /mac
parent6d6b5b0d0e9c53fadc2e50abbd967d516a317486 (diff)
downloadtcl-24229b74b75e8ef219e5f08228243037b6ee7131.zip
tcl-24229b74b75e8ef219e5f08228243037b6ee7131.tar.gz
tcl-24229b74b75e8ef219e5f08228243037b6ee7131.tar.bz2
* generic/tclFileName.c (TclGlob): mac specific fix to
recent changes in 'glob -tails' handling. * mac/tclMacPort.h: * mac/tclMacChan.c: fixed TIP#91 bustage. * mac/tclMacResource.c (Tcl_MacConvertTextResource): added utf conversion of text resource contents. * tests/macFCmd.test (macFCmd-1.2): allow CWIE creator.
Diffstat (limited to 'mac')
-rw-r--r--mac/tclMacChan.c10
-rw-r--r--mac/tclMacPort.h11
-rw-r--r--mac/tclMacResource.c18
3 files changed, 26 insertions, 13 deletions
diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c
index d29c80e..0407a59 100644
--- a/mac/tclMacChan.c
+++ b/mac/tclMacChan.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: tclMacChan.c,v 1.15 2002/05/24 21:19:06 dkf Exp $
+ * RCS: @(#) $Id: tclMacChan.c,v 1.16 2002/06/05 11:59:38 das Exp $
*/
#include "tclInt.h"
@@ -131,8 +131,8 @@ static int StdIOInput _ANSI_ARGS_((ClientData instanceData,
char *buf, int toRead, int *errorCode));
static int StdIOOutput _ANSI_ARGS_((ClientData instanceData,
CONST char *buf, int toWrite, int *errorCode));
-static Tcl_WideInt StdIOSeek _ANSI_ARGS_((ClientData instanceData,
- Tcl_WideInt offset, int mode, int *errorCode));
+static int StdIOSeek _ANSI_ARGS_((ClientData instanceData,
+ long offset, int mode, int *errorCode));
static int StdReady _ANSI_ARGS_((ClientData instanceData,
int mask));
@@ -590,10 +590,10 @@ StdIOOutput(
*----------------------------------------------------------------------
*/
-static Tcl_WideInt
+static int
StdIOSeek(
ClientData instanceData, /* Unused. */
- Tcl_WideInt offset, /* Offset to seek to. */
+ long offset, /* Offset to seek to. */
int mode, /* Relative to where should we seek? */
int *errorCodePtr) /* To store error code. */
{
diff --git a/mac/tclMacPort.h b/mac/tclMacPort.h
index abc30aa..5df25b7 100644
--- a/mac/tclMacPort.h
+++ b/mac/tclMacPort.h
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacPort.h,v 1.14 2001/11/23 01:28:12 das Exp $
+ * RCS: @(#) $Id: tclMacPort.h,v 1.15 2002/06/05 11:59:44 das Exp $
*/
@@ -29,6 +29,15 @@
*/
#include "tclErrno.h"
+
+#ifndef EOVERFLOW
+# ifdef EFBIG
+# define EOVERFLOW EFBIG /* The object couldn't fit in the datatype */
+# else /* !EFBIG */
+# define EOVERFLOW EINVAL /* Better than nothing! */
+# endif /* EFBIG */
+#endif /* !EOVERFLOW */
+
#include <float.h>
#ifdef THINK_C
diff --git a/mac/tclMacResource.c b/mac/tclMacResource.c
index 7052f2b..78f0bc5 100644
--- a/mac/tclMacResource.c
+++ b/mac/tclMacResource.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacResource.c,v 1.13 2002/04/08 09:02:52 das Exp $
+ * RCS: @(#) $Id: tclMacResource.c,v 1.14 2002/06/05 11:59:49 das Exp $
*/
#include <Errors.h>
@@ -1387,20 +1387,24 @@ Tcl_MacConvertTextResource(
{
int i, size;
char *resultStr;
+ Tcl_DString dstr;
size = GetResourceSizeOnDisk(resource);
- resultStr = ckalloc(size + 1);
+ Tcl_ExternalToUtfDString(NULL, *resource, size, &dstr);
+
+ size = Tcl_DStringLength(&dstr) + 1;
+ resultStr = (char *) ckalloc((unsigned) size);
+
+ memcpy((VOID *) resultStr, (VOID *) Tcl_DStringValue(&dstr), (size_t) size);
+
+ Tcl_DStringFree(&dstr);
for (i=0; i<size; i++) {
- if ((*resource)[i] == '\r') {
+ if (resultStr[i] == '\r') {
resultStr[i] = '\n';
- } else {
- resultStr[i] = (*resource)[i];
}
}
-
- resultStr[size] = '\0';
return resultStr;
}