X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=StdLib%2FLibC%2FUefi%2FInteractiveIO%2FCanonRead.c;h=8c8e076d80b6f6be7efe719ac53a6d2cd6038bf4;hp=db6af6e4bfa60ff3956b57a53b4be0ad786414e1;hb=24903bc48a324d42b284805ede9c5ee1db906e44;hpb=8dd618d2110bea0d3c3073b66eb51bc622e81c68 diff --git a/StdLib/LibC/Uefi/InteractiveIO/CanonRead.c b/StdLib/LibC/Uefi/InteractiveIO/CanonRead.c index db6af6e4bf..8c8e076d80 100644 --- a/StdLib/LibC/Uefi/InteractiveIO/CanonRead.c +++ b/StdLib/LibC/Uefi/InteractiveIO/CanonRead.c @@ -3,7 +3,7 @@ The functions assume that isatty() is TRUE at the time they are called. - Copyright (c) 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -87,6 +87,10 @@ IIO_CanonRead ( // Input and process characters until BufferSize is exhausted. do { InChar = IIO_GetInChar(filp, FirstRead); + if (InChar == WEOF) { + NumRead = 0; + break; + } FirstRead = FALSE; Activate = TRUE; if(InChar == CHAR_CARRIAGE_RETURN) { @@ -128,6 +132,8 @@ IIO_CanonRead ( } else if(CCEQ(Termio->c_cc[VEOF], InChar)) { InChar = WEOF; + NumRead = 0; + EchoIsOK = FALSE; // Buffer, but don't echo this character } else if(CCEQ(Termio->c_cc[VEOL], InChar)) { EchoIsOK = FALSE; // Buffer, but don't echo this character