diff options
| author | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-12-21 18:20:53 +0800 |
|---|---|---|
| committer | Sadeep Madurange <smadurange@users.noreply.github.com> | 2021-12-21 18:20:53 +0800 |
| commit | 81b3b08c46f906e1969334975636f8cdb4dad464 (patch) | |
| tree | e523b84aea1385ea704e0254e5b2bb806e868838 /4 | |
| parent | 92701707e22651a74442b43387f07abf565844cd (diff) | |
| download | k&r-exercises-81b3b08c46f906e1969334975636f8cdb4dad464.tar.gz | |
4.11
Diffstat (limited to '4')
| -rw-r--r-- | 4/11.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -126,11 +126,11 @@ int getch() { return (bufp > 0) ? buf[--bufp] : getchar(); } int getop(char s[]) { int c, i, rc; - static int pc = EOF; + static int pc = ' '; - if (pc != EOF && pc != ' ' && pc != '\t') { + if (pc != ' ' && pc != '\t') { c = pc; - pc = EOF; + pc = ' '; } else { while ((s[0] = c = getch()) == ' ' || c == '\t') ; |
