This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Borland problem with quoted pre-processor macros in response files
[perl5.git]
/
doio.c
diff --git
a/doio.c
b/doio.c
index
25756ab
..
809459f
100644
(file)
--- a/
doio.c
+++ b/
doio.c
@@
-258,17
+258,10
@@
Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
}
mode[0] = 'w';
writing = 1;
}
mode[0] = 'w';
writing = 1;
-#ifdef HAS_STRLCAT
if (out_raw)
if (out_raw)
- strlcat(mode, "b", PERL_MODE_MAX - 1);
+
my_
strlcat(mode, "b", PERL_MODE_MAX - 1);
else if (out_crlf)
else if (out_crlf)
- strlcat(mode, "t", PERL_MODE_MAX - 1);
-#else
- if (out_raw)
- strcat(mode, "b");
- else if (out_crlf)
- strcat(mode, "t");
-#endif
+ my_strlcat(mode, "t", PERL_MODE_MAX - 1);
if (num_svs > 1) {
fp = PerlProc_popen_list(mode, num_svs, svp);
}
if (num_svs > 1) {
fp = PerlProc_popen_list(mode, num_svs, svp);
}
@@
-296,17
+289,10
@@
Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
}
writing = 1;
}
writing = 1;
-#ifdef HAS_STRLCAT
if (out_raw)
if (out_raw)
- strlcat(mode, "b", PERL_MODE_MAX - 1);
+
my_
strlcat(mode, "b", PERL_MODE_MAX - 1);
else if (out_crlf)
else if (out_crlf)
- strlcat(mode, "t", PERL_MODE_MAX - 1);
-#else
- if (out_raw)
- strcat(mode, "b");
- else if (out_crlf)
- strcat(mode, "t");
-#endif
+ my_strlcat(mode, "t", PERL_MODE_MAX - 1);
if (*type == '&') {
duplicity:
dodup = PERLIO_DUP_FD;
if (*type == '&') {
duplicity:
dodup = PERLIO_DUP_FD;
@@
-429,17
+415,10
@@
Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
type++;
} while (isSPACE(*type));
mode[0] = 'r';
type++;
} while (isSPACE(*type));
mode[0] = 'r';
-#ifdef HAS_STRLCAT
if (in_raw)
if (in_raw)
- strlcat(mode, "b", PERL_MODE_MAX - 1);
+
my_
strlcat(mode, "b", PERL_MODE_MAX - 1);
else if (in_crlf)
else if (in_crlf)
- strlcat(mode, "t", PERL_MODE_MAX - 1);
-#else
- if (in_raw)
- strcat(mode, "b");
- else if (in_crlf)
- strcat(mode, "t");
-#endif
+ my_strlcat(mode, "t", PERL_MODE_MAX - 1);
if (*type == '&') {
goto duplicity;
}
if (*type == '&') {
goto duplicity;
}
@@
-490,17
+469,10
@@
Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
TAINT_PROPER("piped open");
mode[0] = 'r';
TAINT_PROPER("piped open");
mode[0] = 'r';
-#ifdef HAS_STRLCAT
if (in_raw)
if (in_raw)
- strlcat(mode, "b", PERL_MODE_MAX - 1);
+
my_
strlcat(mode, "b", PERL_MODE_MAX - 1);
else if (in_crlf)
else if (in_crlf)
- strlcat(mode, "t", PERL_MODE_MAX - 1);
-#else
- if (in_raw)
- strcat(mode, "b");
- else if (in_crlf)
- strcat(mode, "t");
-#endif
+ my_strlcat(mode, "t", PERL_MODE_MAX - 1);
if (num_svs > 1) {
fp = PerlProc_popen_list(mode,num_svs,svp);
if (num_svs > 1) {
fp = PerlProc_popen_list(mode,num_svs,svp);
@@
-528,17
+500,10
@@
Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
;
mode[0] = 'r';
;
mode[0] = 'r';
-#ifdef HAS_STRLCAT
if (in_raw)
if (in_raw)
- strlcat(mode, "b", PERL_MODE_MAX - 1);
+
my_
strlcat(mode, "b", PERL_MODE_MAX - 1);
else if (in_crlf)
else if (in_crlf)
- strlcat(mode, "t", PERL_MODE_MAX - 1);
-#else
- if (in_raw)
- strcat(mode, "b");
- else if (in_crlf)
- strcat(mode, "t");
-#endif
+ my_strlcat(mode, "t", PERL_MODE_MAX - 1);
if (*name == '-' && name[1] == '\0') {
fp = PerlIO_stdin();
if (*name == '-' && name[1] == '\0') {
fp = PerlIO_stdin();
@@
-1321,7
+1286,7
@@
Perl_my_stat(pTHX)
#ifdef HAS_DIRFD
return (PL_laststatval = PerlLIO_fstat(dirfd(IoDIRP(io)), &PL_statcache));
#else
#ifdef HAS_DIRFD
return (PL_laststatval = PerlLIO_fstat(dirfd(IoDIRP(io)), &PL_statcache));
#else
-
DIE
(aTHX_ PL_no_func, "dirfd");
+
Perl_die
(aTHX_ PL_no_func, "dirfd");
#endif
} else {
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
#endif
} else {
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
@@
-1478,10
+1443,9
@@
Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
char *cmd;
/* Make a copy so we can change it */
char *cmd;
/* Make a copy so we can change it */
- const int cmdlen = strlen(incmd);
- Newx(cmd, cmdlen+1, char);
- strncpy(cmd, incmd, cmdlen);
- cmd[cmdlen] = 0;
+ const Size_t cmdlen = strlen(incmd) + 1;
+ Newx(cmd, cmdlen, char);
+ my_strlcpy(cmd, incmd, cmdlen);
while (*cmd && isSPACE(*cmd))
cmd++;
while (*cmd && isSPACE(*cmd))
cmd++;
@@
-1493,19
+1457,11
@@
Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
char flags[PERL_FLAGS_MAX];
if (strnEQ(cmd,PL_cshname,PL_cshlen) &&
strnEQ(cmd+PL_cshlen," -c",3)) {
char flags[PERL_FLAGS_MAX];
if (strnEQ(cmd,PL_cshname,PL_cshlen) &&
strnEQ(cmd+PL_cshlen," -c",3)) {
-#ifdef HAS_STRLCPY
- strlcpy(flags, "-c", PERL_FLAGS_MAX);
-#else
- strcpy(flags,"-c");
-#endif
+ my_strlcpy(flags, "-c", PERL_FLAGS_MAX);
s = cmd+PL_cshlen+3;
if (*s == 'f') {
s++;
s = cmd+PL_cshlen+3;
if (*s == 'f') {
s++;
-#ifdef HAS_STRLCPY
- strlcat(flags, "f", PERL_FLAGS_MAX - 2);
-#else
- strcat(flags,"f");
-#endif
+ my_strlcat(flags, "f", PERL_FLAGS_MAX - 2);
}
if (*s == ' ')
s++;
}
if (*s == ' ')
s++;
@@
-2317,7
+2273,7
@@
Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
STRLEN len;
const char *mbuf = SvPV_const(mstr, len);
STRLEN len;
const char *mbuf = SvPV_const(mstr, len);
- const I32 n = (
len > msize) ? msize :
len;
+ const I32 n = (
(I32)len > msize) ? msize : (I32)
len;
Copy(mbuf, shm + mpos, n, char);
if (n < msize)
memzero(shm + mpos + n, msize - n);
Copy(mbuf, shm + mpos, n, char);
if (n < msize)
memzero(shm + mpos + n, msize - n);