Bug 14753 - Sourcing an empty file results in 'more input prompt'
Sourcing an empty file results in 'more input prompt'
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Low-level
R 2.14.0
All All
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-10 18:04 UTC by Olaf Mersmann
Modified: 2011-12-11 16:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olaf Mersmann 2011-12-10 18:04:33 UTC
Steps to reproduce:

 1. Create an empty file foo.R
 2. Start an interactive R session.
 3. Type:
    source("foo.R")
 4. Observe prompt

I would expect this to return me to the standard '>' prompt instead of the 'more input expected' prompt '?'.

I have reproduced this both on Windows an Linux with R 2.14.0 and R-patched. Here's the sessionInfo() of both builds on Linux:

R version 2.14.0 (2011-10-31)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_2.14.0

R version 2.14.0 Patched (2011-12-09 r57854)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base  

Cheers,
Olaf
Comment 1 Brian Ripley 2011-12-11 16:29:27 UTC
It was a bug in the way srcfile is handled in 2.14.0: the .Internal(parse()) call was expecting length(lines) > 0.