Change 20929 by [EMAIL PROTECTED] on 2003/08/29 12:55:12
Subject: [PATCH] maint / blead tweaks in perlio.c for Cygwin
From: "Gerrit P. Haase" <[EMAIL PROTECTED]>
Date: Thu, 28 Aug 2003 08:18:51 +0200
Message-ID: <[EMAIL PROTECTED]>
(changed so that the 'b' is always appended)
Affected files ...
... //depot/perl/perlio.c#235 edit
Differences ...
==== //depot/perl/perlio.c#235 (text) ====
Index: perl/perlio.c
--- perl/perlio.c#234~20674~ Wed Aug 13 04:57:47 2003
+++ perl/perlio.c Fri Aug 29 05:55:12 2003
@@ -2609,7 +2609,7 @@
while (*mode) {
*tmode++ = *mode++;
}
-#ifdef PERLIO_USING_CRLF
+#if defined(PERLIO_USING_CRLF) || defined(__CYGWIN__)
*tmode++ = 'b';
#endif
*tmode = '\0';
@@ -2710,25 +2710,28 @@
fd = PerlLIO_open3(path, imode, perm);
}
else {
- FILE *stdio = PerlSIO_fopen(path, mode);
- if (stdio) {
- PerlIOStdio *s;
- if (!f) {
- f = PerlIO_allocate(aTHX);
- }
- if ((f = PerlIO_push(aTHX_ f, self,
- (mode = PerlIOStdio_mode(mode, tmode)),
- PerlIOArg))) {
- s = PerlIOSelf(f, PerlIOStdio);
- s->stdio = stdio;
- PerlIOUnix_refcnt_inc(fileno(s->stdio));
- }
- return f;
- }
- else {
- return NULL;
- }
+ /* Append the 'b' - more correct for CRLF platforms
+ * and Cygwin and should be harmless (since it's a
+ * no-op) elsewhere. */
+ mode = PerlIOStdio_mode(mode, tmode);
+ {
+ FILE *stdio = PerlSIO_fopen(path, mode);
+ if (stdio) {
+ PerlIOStdio *s;
+ if (!f) {
+ f = PerlIO_allocate(aTHX);
+ }
+ if ((f = PerlIO_push(aTHX_ f, self,
+ mode, PerlIOArg))) {
+ s = PerlIOSelf(f, PerlIOStdio);
+ s->stdio = stdio;
+ PerlIOUnix_refcnt_inc(fileno(s->stdio));
+ }
+ return f;
+ }
+ }
}
+ return NULL;
}
if (fd >= 0) {
FILE *stdio = NULL;
End of Patch.