mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-07 16:54:48 +00:00
Tweak MemoryBuffer::getSTDIN so that it returns after the first EOF.
It doesn't matter for piped input, but it's annoying when typing at the console. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7ce55362c7
commit
96cd7af935
@ -263,8 +263,11 @@ MemoryBuffer *MemoryBuffer::getSTDIN() {
|
||||
|
||||
// Read in all of the data from stdin, we cannot mmap stdin.
|
||||
sys::Program::ChangeStdinToBinary();
|
||||
while (size_t ReadBytes = fread(Buffer, sizeof(char), 4096*4, stdin))
|
||||
size_t ReadBytes;
|
||||
do {
|
||||
ReadBytes = fread(Buffer, sizeof(char), sizeof(Buffer), stdin);
|
||||
FileData.insert(FileData.end(), Buffer, Buffer+ReadBytes);
|
||||
} while (ReadBytes == sizeof(Buffer));
|
||||
|
||||
FileData.push_back(0); // &FileData[Size] is invalid. So is &*FileData.end().
|
||||
size_t Size = FileData.size();
|
||||
|
Loading…
Reference in New Issue
Block a user