Changeset 440
- Timestamp:
- 08/03/07 21:45:52 (1 year ago)
- Files:
-
- trunk/src/z-file.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/z-file.c
r366 r440 159 159 char *s = buf; 160 160 int len; 161 161 162 #ifdef MACH_O_CARBON 163 164 /* For the \r vs. \r\n vs \n handling code below */ 165 bool seen_cr = FALSE; 166 167 #endif /* MACH_O_CARBON */ 162 168 163 169 /* Paranoia */ … … 203 209 * end of line, especially since the introduction of OS X. 204 210 * MPW tools were also very tolerant to the Unix EOL. 211 * 212 * Watch for \r; when found, set flag and advance. 213 * If the next character isn't \n, rewind the file one character 214 * and act like we found \n anyway to end the line. 205 215 */ 206 if (c == '\r') c = '\n'; 216 if (c == '\r') 217 { 218 seen_cr = TRUE; 219 continue; 220 } 221 else 222 seen_cr = FALSE; 223 224 if (seen_cr && c != '\n') 225 { 226 fseek(fff, -1, SEEK_CUR); 227 228 /* Put a fake newline in to end the line */ 229 c = '\n'; 230 } 207 231 208 232 #endif /* MACH_O_CARBON */
