From: Rolf K. <lab...@us...> - 2007-12-14 21:36:28
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15252 Modified Files: lvutil.c lvzip.cws Log Message: Hopefully successful bugfix for long path names in MacOS Index: lvzip.cws =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/lvzip.cws,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lvzip.cws 10 Dec 2007 13:47:36 -0000 1.2 --- lvzip.cws 14 Dec 2007 21:36:20 -0000 1.3 *************** *** 9,16 **** Project 0001 = "lvzip.prj" Drag Bar Left = 160 ! Window Top = 53 ! Window Left = 1331 ! Window Bottom = 1039 ! Window Right = 2867 Maximized = False Maximized Children = False --- 9,16 ---- Project 0001 = "lvzip.prj" Drag Bar Left = 160 ! Window Top = 59 ! Window Left = 29 ! Window Bottom = 1045 ! Window Right = 1565 Maximized = False Maximized Children = False *************** *** 26,30 **** Break At First Statement = False Sort Type = "File Name" ! Number of Opened Files = 0 Window Confinement Region Enabled = True MainColumnWidth = 141 --- 26,30 ---- Break At First Statement = False Sort Type = "File Name" ! Number of Opened Files = 1 Window Confinement Region Enabled = True MainColumnWidth = 141 *************** *** 44,47 **** --- 44,57 ---- [File 0001] + Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/lvutil.c" + File Type = "CSource" + Disk Date = 3280430225 + In Projects = "1," + Window Top = 25 + Window Left = 6 + Window Z-Order = 1 + Source Window State = "1,0,0,0,0,0,0,0,0,80,0,0,0,0,0,25,0,0,0,0,349,676,1,0," + + [File 0002] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/adler32.c" File Type = "CSource" *************** *** 52,56 **** Source Window State = "1,7,8,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,284,676,1,0," ! [File 0002] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/compress.c" File Type = "CSource" --- 62,66 ---- Source Window State = "1,7,8,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,284,676,1,0," ! [File 0003] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/compress.c" File Type = "CSource" *************** *** 61,65 **** Source Window State = "1,7,8,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,282,838,1,0," ! [File 0003] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crc32.c" File Type = "CSource" --- 71,75 ---- Source Window State = "1,7,8,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,282,838,1,0," ! [File 0004] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crc32.c" File Type = "CSource" *************** *** 70,74 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,27,60,283,794,1,0," ! [File 0004] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crc32.h" File Type = "Include" --- 80,84 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,27,60,283,794,1,0," ! [File 0005] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crc32.h" File Type = "Include" *************** *** 77,81 **** Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0005] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crypt.h" File Type = "Include" --- 87,91 ---- Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0006] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/crypt.h" File Type = "Include" *************** *** 86,90 **** Source Window State = "1,88,88,88,34,35,34,0,0,0,0,0,0,0,0,0,77,0,86,21,517,1234,1,0," ! [File 0006] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/deflate.c" File Type = "CSource" --- 96,100 ---- Source Window State = "1,88,88,88,34,35,34,0,0,0,0,0,0,0,0,0,77,0,86,21,517,1234,1,0," ! [File 0007] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/deflate.c" File Type = "CSource" *************** *** 95,99 **** Source Window State = "1,98,99,98,0,0,0,0,0,0,0,0,0,0,0,0,27,0,91,22,847,917,1,0," ! [File 0007] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/deflate.h" File Type = "Include" --- 105,109 ---- Source Window State = "1,98,99,98,0,0,0,0,0,0,0,0,0,0,0,0,27,0,91,22,847,917,1,0," ! [File 0008] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/deflate.h" File Type = "Include" *************** *** 104,108 **** Source Window State = "1,298,298,298,0,11,11,0,0,0,0,0,0,0,0,0,270,0,298,0,530,1049,1,0," ! [File 0008] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/gzio.c" File Type = "CSource" --- 114,118 ---- Source Window State = "1,298,298,298,0,11,11,0,0,0,0,0,0,0,0,0,270,0,298,0,530,1049,1,0," ! [File 0009] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/gzio.c" File Type = "CSource" *************** *** 113,117 **** Source Window State = "1,11,12,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,399,871,1,0," ! [File 0009] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/infback.c" File Type = "CSource" --- 123,127 ---- Source Window State = "1,11,12,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,399,871,1,0," ! [File 0010] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/infback.c" File Type = "CSource" *************** *** 122,126 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0010] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffast.c" File Type = "CSource" --- 132,136 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0011] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffast.c" File Type = "CSource" *************** *** 131,135 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,852,1,0," ! [File 0011] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffast.h" File Type = "Include" --- 141,145 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,852,1,0," ! [File 0012] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffast.h" File Type = "Include" *************** *** 138,142 **** Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0012] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffixed.h" File Type = "Include" --- 148,152 ---- Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0013] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inffixed.h" File Type = "Include" *************** *** 145,149 **** Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0013] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inflate.c" File Type = "CSource" --- 155,159 ---- Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0014] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inflate.c" File Type = "CSource" *************** *** 154,158 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0014] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inflate.h" File Type = "Include" --- 164,168 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0015] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inflate.h" File Type = "Include" *************** *** 163,167 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,388,779,1,0," ! [File 0015] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inftrees.c" File Type = "CSource" --- 173,177 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,388,779,1,0," ! [File 0016] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inftrees.c" File Type = "CSource" *************** *** 170,176 **** Window Top = 23 Window Left = 176 ! Source Window State = "1,0,0,0,0,0,0,0,0,118,0,0,0,0,0,42,3,0,38,0,570,975,1,0," ! [File 0016] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inftrees.h" File Type = "Include" --- 180,186 ---- Window Top = 23 Window Left = 176 ! Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,38,0,570,975,1,0," ! [File 0017] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/inftrees.h" File Type = "Include" *************** *** 181,185 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,499,1052,1,0," ! [File 0017] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/ioapi.c" File Type = "CSource" --- 191,195 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,499,1052,1,0," ! [File 0018] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/ioapi.c" File Type = "CSource" *************** *** 190,194 **** Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0018] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/ioapi.h" File Type = "Include" --- 200,204 ---- Source Window State = "1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,284,676,1,0," ! [File 0019] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/ioapi.h" File Type = "Include" *************** *** 197,201 **** Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0019] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iomem.c" File Type = "CSource" --- 207,211 ---- Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0020] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iomem.c" File Type = "CSource" *************** *** 206,210 **** Source Window State = "1,105,105,105,12,96,12,0,0,0,0,0,0,0,0,0,92,0,105,92,491,939,1,0," ! [File 0020] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iomem.h" File Type = "Include" --- 216,220 ---- Source Window State = "1,105,105,105,12,96,12,0,0,0,0,0,0,0,0,0,92,0,105,92,491,939,1,0," ! [File 0021] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iomem.h" File Type = "Include" *************** *** 215,219 **** Source Window State = "1,9,10,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,327,888,1,0," ! [File 0021] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iowin32.c" File Type = "CSource" --- 225,229 ---- Source Window State = "1,9,10,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,327,888,1,0," ! [File 0022] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iowin32.c" File Type = "CSource" *************** *** 222,228 **** Window Top = 26 Window Left = 66 ! Source Window State = "1,70,71,70,0,0,0,0,0,123,0,60,0,0,0,38,60,0,70,0,528,1016,1,0," ! [File 0022] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iowin32.h" File Type = "Include" --- 232,238 ---- Window Top = 26 Window Left = 66 ! Source Window State = "1,70,71,70,0,0,0,0,0,0,0,60,0,0,0,0,60,0,70,0,528,1016,1,0," ! [File 0023] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/iowin32.h" File Type = "Include" *************** *** 231,235 **** Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0023] Path = "/c/Work/OpenG/opengtoolkit/cintools/labview.lib" File Type = "Library" --- 241,245 ---- Source Window State = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," ! [File 0024] Path = "/c/Work/OpenG/opengtoolkit/cintools/labview.lib" File Type = "Library" *************** *** 237,253 **** In Projects = "1," - [File 0024] - Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/lvutil.c" - File Type = "CSource" - Disk Date = 3280138995 - In Projects = "1," - Window Top = 25 - Window Left = 10 - Source Window State = "1,821,821,821,8,43,8,0,0,0,0,0,0,0,0,0,359,0,378,19,518,1094,1,0," - [File 0025] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/lvutil.h" File Type = "Include" ! Disk Date = 3280138886 In Projects = "1," Window Top = 48 --- 247,254 ---- In Projects = "1," [File 0025] Path = "/c/Work/OpenG/opengtoolkit/lvzip/c_source/lvutil.h" File Type = "Include" ! Disk Date = 3280141347 In Projects = "1," Window Top = 48 *************** *** 307,311 **** Window Top = 25 Window Left = 5 ! Source Window State = "1,1538,1539,1538,0,0,0,0,0,141,0,0,0,0,0,41,1527,0,1538,0,568,1163,1,0," [File 0032] --- 308,312 ---- Window Top = 25 Window Left = 5 ! Source Window State = "1,1538,1539,1538,0,0,0,0,0,0,0,0,0,0,0,0,1527,0,1538,0,568,1163,1,0," [File 0032] Index: lvutil.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/lvutil.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lvutil.c 10 Dec 2007 13:47:36 -0000 1.4 --- lvutil.c 14 Dec 2007 21:36:20 -0000 1.5 *************** *** 42,78 **** { MgErr err; - OSErr ret; - LStrPtr lstr; - Str255 name; int32 pathLen = -1; err = FPathToText(path, (LStrPtr)&pathLen); if (err) - DEBUGPRINTF(("FPathToText1: err = %ld", err)); - if (!err) { ! if (pathLen <= 255) ! { ! lstr = (LStrPtr)DSNewPClr(sizeof(int32) + pathLen + 1); ! if (!lstr) ! return mFullErr; ! lstr->cnt = pathLen; ! err = FPathToText(path, lstr); ! lstr->str[lstr->cnt] = 0; ! if (err) ! DEBUGPRINTF(("FPathToText2: err = %ld", err)); ! if (!err) ! { ! CToPStr(lstr->str, name); ! ret = MakeFileSpec(0, 0, name, fss); ! err = OSErrToLVErr(ret); ! if (err) ! DEBUGPRINTF(("MakeFileSpec: ret = %d, err = %ld", ret, err)); ! DEBUGPRINTF(("MakeFileSpec: len = %ld, len2 = %d, path = %s", lstr->cnt, (int16)name[0], lstr->str)); ! } } else ! err = mgArgErr; } return err; --- 42,83 ---- { MgErr err; int32 pathLen = -1; + DEBUGPRINTF(("FPathToText1: path = %z", path)); err = FPathToText(path, (LStrPtr)&pathLen); if (err) { ! DEBUGPRINTF(("FPathToText2: err = %ld", err)); ! } ! else ! { ! OSErr ret; ! LStrPtr lstr; ! Str255 name; ! if (pathLen > 255) ! return mgArgErr; ! ! lstr = (LStrPtr)DSNewPClr(sizeof(int32) + pathLen + 1); ! if (!lstr) ! return mFullErr; ! ! lstr->cnt = pathLen; ! err = FPathToText(path, lstr); ! lstr->str[lstr->cnt] = 0; ! if (err) ! { ! DEBUGPRINTF(("FPathToText3: err = %ld", err)); } else ! { ! CToPStr(lstr->str, name); ! ret = MakeFileSpec(0, 0, name, fss); ! err = OSErrToLVErr(ret); ! if (err) ! DEBUGPRINTF(("MakeFileSpec: ret = %d, err = %ld, len = %ld, len2 = %d, path = %s", ! ret, err, lstr->cnt, (int16)name[0], lstr->str)); ! } ! DSDisposePtr(lstr); } return err; *************** *** 82,89 **** { OSErr err = FSMakeFSSpec(vol, dirID, path, fss); - if (err) { ! DEBUGPRINTF(("MakeFSSpec: err = %ld", err)); if (fnfErr == err) { --- 87,93 ---- { OSErr err = FSMakeFSSpec(vol, dirID, path, fss); if (err) { ! DEBUGPRINTF(("FSMakeFSSpec: err = %ld", err)); if (fnfErr == err) { *************** *** 98,118 **** Str255 temp; uChar *p; ! int32 i; DEBUGPRINTF(("MakeFileSpec: trying with subpaths")); /* remove the last elt of the path and see if we have success */ PStrCpy(temp, path); ! for (i = 0, p = (uChar*)&temp[PStrLen(path)]; p > temp; p--, i++) ! if (*p == ':') break; ! if (p <= temp) ! return err; ! PStrLen(temp) = PStrLen(path) - i; ! err = MakeFileSpec(vol, dirID, temp, &fst); ! DEBUGPRINTF(("MakeFileSpec: err2 = %ld", err)); if (!err || (fnfErr == err)) { PStrLen(p) = i; ! err = FSMakeFSSpec(vol, fst.parID, p, fss); ! DEBUGPRINTF(("MakeFSSpec: err3 = %ld", err)); } } --- 102,130 ---- Str255 temp; uChar *p; ! int32 i = 0; DEBUGPRINTF(("MakeFileSpec: trying with subpaths")); /* remove the last elt of the path and see if we have success */ PStrCpy(temp, path); ! p = (uChar*)&temp[PStrLen(path)]; ! ! do ! { ! for (; p > temp; p--, i++) ! if (*p == ':') break; ! if (p <= temp) ! return err; ! PStrLen(temp) = PStrLen(path) - (i + 1); ! err = FSMakeFSSpec(vol, dirID, temp, &fst); ! if (err) ! DEBUGPRINTF(("FSMakeFSSpec: err2 = %ld, path = %p", err, temp)); ! } while (bdNamErr == err); ! if (!err || (fnfErr == err)) { PStrLen(p) = i; ! err = MakeFileSpec(fst.vRefNum, fst.parID, p, fss); ! if (err) ! DEBUGPRINTF(("MakeFileSpec: err = %ld, path = %p", err, p)); } } *************** *** 121,135 **** } ! /* Workaround adapted from Apple Developer Support sample code in */ ! /* MoreFiles 1.2.1:FSpCompat.c... (DH) */ ! /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */ ! /* returned in the parID field when making an FSSpec to the volume's */ ! /* root directory by passing a full pathname in MakeFSSpec's */ ! /* fileName parameter. */ if ((err == mgNoErr) && (fss->parID == 0)) { fss->parID = fsRtParID; } ! return mgNoErr; } --- 133,146 ---- } ! /* Workaround adapted from Apple Developer Support sample code in ! MoreFiles 1.2.1:FSpCompat.c. ! Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is ! returned in the parID field when making an FSSpec to the volume's root ! directory by passing a full pathname in MakeFSSpec's fileName parameter. */ if ((err == mgNoErr) && (fss->parID == 0)) { fss->parID = fsRtParID; } ! return err; } *************** *** 248,252 **** err = FPathToText(path, *lstr); if (err) ! DSDisposePtr((UPtr)lstr); } return err; --- 259,263 ---- err = FPathToText(path, *lstr); if (err) ! DSDisposePtr((UPtr)*lstr); } return err; |