projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05ef5ae
)
[CRT]
author
Amine Khaldi
<amine.khaldi@reactos.org>
Wed, 14 May 2014 14:55:37 +0000
(14:55 +0000)
committer
Amine Khaldi
<amine.khaldi@reactos.org>
Wed, 14 May 2014 14:55:37 +0000
(14:55 +0000)
* Update ungetc().
CORE-8080
svn path=/trunk/; revision=63293
reactos/lib/sdk/crt/stdio/file.c
patch
|
blob
|
history
diff --git
a/reactos/lib/sdk/crt/stdio/file.c
b/reactos/lib/sdk/crt/stdio/file.c
index
ec22bfe
..
ae6164e
100644
(file)
--- a/
reactos/lib/sdk/crt/stdio/file.c
+++ b/
reactos/lib/sdk/crt/stdio/file.c
@@
-3880,13
+3880,19
@@
int CDECL ungetc(int c, FILE * file)
return EOF;
_lock_file(file);
- if(file->_bufsiz == 0) {
- alloc_buffer(file);
+ if(file->_bufsiz == 0 && alloc_buffer(file))
file->_ptr++;
- }
if(file->_ptr>file->_base) {
file->_ptr--;
- *file->_ptr=c;
+ if(file->_flag & _IOSTRG) {
+ if(*file->_ptr != c) {
+ file->_ptr++;
+ _unlock_file(file);
+ return EOF;
+ }
+ }else {
+ *file->_ptr = c;
+ }
file->_cnt++;
clearerr(file);
_unlock_file(file);