OSDN Git Service

In preparation for a Mac OS X version, allow both Unix and Mac line termination in...
authorEric Branlund <ebranlund@fastmail.com>
Sun, 5 Apr 2020 02:51:56 +0000 (19:51 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Sun, 5 Apr 2020 02:51:56 +0000 (19:51 -0700)
src/util.c

index b9f8905..b226f43 100644 (file)
@@ -450,7 +450,7 @@ errr my_fgets(FILE *fff, char *buf, huge n)
                /* Convert weirdness */
                for (s = tmp; *s; s++)
                {
-#if defined(MACINTOSH) || defined(MACH_O_CARBON)
+#if defined(MACINTOSH) || defined(MACH_O_CARBON) || defined(MACH_O_COCOA)
 
                        /*
                         * Be nice to the Macintosh, where a file can have Mac or Unix
@@ -459,7 +459,7 @@ errr my_fgets(FILE *fff, char *buf, huge n)
                         */
                        if (*s == '\r') *s = '\n';
 
-#endif /* MACINTOSH || MACH_O_CARBON */
+#endif /* MACINTOSH || MACH_O_CARBON || MACH_O_COCOA */
 
                        /* Handle newline */
                        if (*s == '\n')