diff options
author | das <das> | 2007-05-09 12:51:30 (GMT) |
---|---|---|
committer | das <das> | 2007-05-09 12:51:30 (GMT) |
commit | 8a9b564349c8e0c0ec7f5c1a97e0c29276188ea0 (patch) | |
tree | 478273342c560ecc51997e42e9bcceb49e36e100 | |
parent | ff2622f3a5e6a322a42b0841a92572fa12d97864 (diff) | |
download | tk-8a9b564349c8e0c0ec7f5c1a97e0c29276188ea0.zip tk-8a9b564349c8e0c0ec7f5c1a97e0c29276188ea0.tar.gz tk-8a9b564349c8e0c0ec7f5c1a97e0c29276188ea0.tar.bz2 |
* generic/tkFileFilter.c (AddClause): OSType endianness fixes.
-rw-r--r-- | generic/tkFileFilter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 0ae1e64..06e63d6 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.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: tkFileFilter.c,v 1.9 2005/11/04 11:52:50 dkf Exp $ + * RCS: @(#) $Id: tkFileFilter.c,v 1.10 2007/05/09 12:51:30 das Exp $ */ #include "tkInt.h" @@ -347,6 +347,7 @@ AddClause( int len; MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType)); CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); + char *string; /* * Convert utf to macRoman, since MacOS types are defined to be 4 @@ -354,8 +355,9 @@ AddClause( */ Tcl_UtfToExternalDString(macRoman, strType, len, &osTypeDS); - - memcpy(&mfPtr->type, Tcl_DStringValue(&osTypeDS), sizeof(OSType)); + string = Tcl_DStringValue(&osTypeDS); + mfPtr->type = (OSType) string[0] << 24 | (OSType) string[1] << 16 | + (OSType) string[2] << 8 | (OSType) string[3]; Tcl_DStringFree(&osTypeDS); /* |