Changeset 1328
- Timestamp:
- Mar 22, 2004, 8:38:43 PM (21 years ago)
- Location:
- trunk/src/emx/src/lib/sys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/__mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1327 r1328 6 6 #include <os2emx.h> 7 7 #include <stdlib.h> 8 #include <string.h> 8 9 #include <errno.h> 9 10 #include <emx/syscalls.h> … … 19 20 ULONG rc; 20 21 int cch; 22 char ch; 21 23 FS_VAR(); 22 24 … … 45 47 46 48 /* 49 * Strip off any trailing slashes. 50 * (Linux and FreeBSD accept this.) 51 */ 52 if (cch <= 0) 53 { 54 cch = strlen(pszPath); 55 if ( cch > 2 56 && ((ch = pszPath[cch - 1]) == '/' || ch == '\\') 57 && pszPath[cch - 2] != ':') 58 { 59 char *psz = alloca(cch); 60 if (!psz) 61 { 62 errno = ENOMEM; 63 LIBCLOG_RETURN_INT(-1); 64 } 65 pszPath = (const char *)memcpy(psz, pszPath, cch); 66 psz[cch - 1] = '\0'; 67 } 68 } 69 else if ( cch > 3 /* includes terminator */ 70 && ((ch = pszPath[cch - 2]) == '/' || ch == '\\') 71 && pszPath[cch - 3] != ':') 72 ((char *)pszPath)[cch - 2] = '\0'; /* rewrite temp buffer. */ 73 74 75 76 /* 47 77 * Do It. 48 78 */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__rmdir.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1327 r1328 5 5 #include <os2emx.h> 6 6 #include <stdlib.h> 7 #include <string.h> 7 8 #include <errno.h> 8 9 #include <emx/syscalls.h> … … 17 18 ULONG rc; 18 19 int cch; 20 char ch; 19 21 FS_VAR(); 20 22 … … 43 45 44 46 /* 47 * Strip off any trailing slashes. 48 * (Linux and FreeBSD accept this.) 49 */ 50 if (cch <= 0) 51 { 52 cch = strlen(pszPath); 53 if ( cch > 2 54 && ((ch = pszPath[cch - 1]) == '/' || ch == '\\') 55 && pszPath[cch - 2] != ':') 56 { 57 char *psz = alloca(cch); 58 if (!psz) 59 { 60 errno = ENOMEM; 61 LIBCLOG_RETURN_INT(-1); 62 } 63 pszPath = (const char *)memcpy(psz, pszPath, cch); 64 psz[cch - 1] = '\0'; 65 } 66 } 67 else if ( cch > 3 /* includes terminator */ 68 && ((ch = pszPath[cch - 2]) == '/' || ch == '\\') 69 && pszPath[cch - 3] != ':') 70 ((char *)pszPath)[cch - 2] = '\0'; /* rewrite temp buffer. */ 71 72 /* 45 73 * Do It. 46 74 */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.