The R Project SVN R

Rev

Rev 77048 | Rev 77874 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77048 Rev 77228
Line 948... Line 948...
948
		 int addtohistory)
948
		 int addtohistory)
949
{
949
{
950
    if(!R_Interactive) {
950
    if(!R_Interactive) {
951
	size_t ll;
951
	size_t ll;
952
	int err = 0;
952
	int err = 0;
953
	if (!R_Slave) {
953
	if (!R_NoEcho) {
954
	    fputs(prompt, stdout);
954
	    fputs(prompt, stdout);
955
	    fflush(stdout); /* make sure prompt is output */
955
	    fflush(stdout); /* make sure prompt is output */
956
	}
956
	}
957
	if (fgets((char *)buf, len, ifp ? ifp: stdin) == NULL)
957
	if (fgets((char *)buf, len, ifp ? ifp: stdin) == NULL)
958
	    return 0;
958
	    return 0;
Line 991... Line 991...
991
   at eof and error */
991
   at eof and error */
992
	if ((err || feof(ifp ? ifp : stdin))
992
	if ((err || feof(ifp ? ifp : stdin))
993
	    && (ll == 0 || buf[ll - 1] != '\n') && ll < (size_t)len) {
993
	    && (ll == 0 || buf[ll - 1] != '\n') && ll < (size_t)len) {
994
	    buf[ll++] = '\n'; buf[ll] = '\0';
994
	    buf[ll++] = '\n'; buf[ll] = '\0';
995
	}
995
	}
996
	if (!R_Slave) {
996
	if (!R_NoEcho) {
997
	    fputs((char *)buf, stdout);
997
	    fputs((char *)buf, stdout);
998
	    fflush(stdout);
998
	    fflush(stdout);
999
	}
999
	}
1000
	return 1;
1000
	return 1;
1001
    }
1001
    }