Displaying 1 result from an estimated 1 matches for "intern_bufsize".
2004 Feb 28
1
Line splitting in system() (PR#6624)
...============================
RCS file: /cvs/R/src/unix/sys-unix.c,v
retrieving revision 1.39
diff -u -r1.39 sys-unix.c
--- unix/sys-unix.c 2003/09/10 11:45:29 1.39
+++ unix/sys-unix.c 2004/02/28 15:20:15
@@ -215,7 +215,8 @@
fp = R_popen(CHAR(STRING_ELT(CAR(args), 0)), x);
for (i = 0; fgets(buf, INTERN_BUFSIZE, fp); i++) {
read = strlen(buf);
- if (read < INTERN_BUFSIZE) buf[read - 1] = '\0'; /* chop final CR */
+ if (read>0 && buf[read-1] == '\n')
+ buf[read - 1] = '\0'; /* chop final CR */
tchar = mkChar(buf);
UNPROTECT(1);
PROTECT...