~mdw
/
sgt
/
agedu
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
645dbd4
)
If TIOCGWINSZ returns a window size of zero, treat it as "window
author
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Nov 2008 07:59:55 +0000
(07:59 +0000)
committer
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Nov 2008 07:59:55 +0000
(07:59 +0000)
size unavailable".
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8290
cda61777
-01e9-0310-a592-
d414129be87e
agedu.c
patch
|
blob
|
blame
|
history
diff --git
a/agedu.c
b/agedu.c
index
5b836e7
..
9ff6bb8
100644
(file)
--- a/
agedu.c
+++ b/
agedu.c
@@
-949,7
+949,9
@@
int main(int argc, char **argv)
ctx->progress = progress;
{
struct winsize ws;
ctx->progress = progress;
{
struct winsize ws;
- if (progress && ioctl(2, TIOCGWINSZ, &ws) == 0)
+ if (progress &&
+ ioctl(2, TIOCGWINSZ, &ws) == 0 &&
+ ws.ws_col > 0)
ctx->progwidth = ws.ws_col - 1;
else
ctx->progwidth = 79;
ctx->progwidth = ws.ws_col - 1;
else
ctx->progwidth = 79;