Ticket #26195: patch-config.c.diff
File patch-config.c.diff, 1.8 KB (added by pixilla (Bradley Giesbrecht), 14 years ago) |
---|
-
config.c
old new 30 30 31 31 #define REALLOC_STEP 10 32 32 33 /* Mac OS X does not define O_CLOEXEC, MAP_POPULATE or MADV_DONTFORK 34 and PATH_MAX is in limits.h - brad@pixilla.com */ 35 #if defined(Darwin) 36 #include <limits.h> 37 #ifndef O_CLOEXEC 38 #define O_CLOEXEC 0 39 #endif 40 #ifndef MAP_POPULATE 41 #define MAP_POPULATE 0 42 #endif 43 #ifndef MADV_DONTFORK 44 #define MADV_DONTFORK 0 45 #endif 46 #define IS_DARWIN 1 47 #else 48 #define IS_DARWIN 0 49 #endif 50 33 51 #if defined(SunOS) 34 52 #include <syslimits.h> 35 53 #if !defined(isblank) … … 100 118 101 119 chptr = start; 102 120 103 while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) { 104 if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) { 105 message(MESS_ERROR, "%s:%d bad %s path %s\n", 106 configFile, lineNum, key, start); 107 return NULL; 121 /* Mac OS X is not liking this, reverting to older code - brad@pixilla.com */ 122 if( !IS_DARWIN ) { 123 while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) { 124 if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) { 125 message(MESS_ERROR, "%s:%d bad %s path %s\n", 126 configFile, lineNum, key, start); 127 return NULL; 128 } 129 chptr += len; 130 } 131 } else { 132 while (*chptr && isprint(*chptr) && *chptr != ' ') { 133 chptr++; 134 } 135 if (*chptr) { 136 message(MESS_ERROR, "%s:%d bad %s path %s\n", 137 configFile, lineNum, key, start); 138 return NULL; 108 139 } 109 chptr += len;110 }111 112 /*113 while (*chptr && isprint(*chptr) && *chptr != ' ')114 chptr++;115 if (*chptr) {116 message(MESS_ERROR, "%s:%d bad %s path %s\n",117 configFile, lineNum, key, start);118 return NULL;119 140 } 120 */121 141 122 142 path = strdup(start); 123 143 … … 127 147 *startPtr = start; 128 148 129 149 return path; 130 150 } else 131 151 return NULL; 132 152 } 133 153