diff options
author | Guillem Jover <guillem@debian.org> | 2013-11-18 20:01:40 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-12-05 10:19:33 +0100 |
commit | cf21cccb98bdb31a84bbe1aa1217c712b47aedd2 (patch) | |
tree | 62b268398ac0cdaf9ef9ffc9a73a0f9d71181226 /dselect/baselist.cc | |
parent | 632c785858b703042f13b6a5f7280fdd45a85f21 (diff) | |
download | dpkg-cf21cccb98bdb31a84bbe1aa1217c712b47aedd2.tar.gz |
Switch variables from int to bool where appropriate
Diffstat (limited to 'dselect/baselist.cc')
-rw-r--r-- | dselect/baselist.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dselect/baselist.cc b/dselect/baselist.cc index 74cd9ef93..43050cf7c 100644 --- a/dselect/baselist.cc +++ b/dselect/baselist.cc @@ -313,7 +313,8 @@ void baselist::refreshinfo() { void baselist::wordwrapinfo(int offset, const char *m) { int usemax= xmax-5; debug(dbg_general, "baselist[%p]::wordwrapinfo(%d, '%s')", this, offset, m); - int wrapping=0; + bool wrapping = false; + for (;;) { int offleft=offset; while (*m == ' ' && offleft>0) { m++; offleft--; } const char *p= strchr(m,'\n'); @@ -321,12 +322,13 @@ void baselist::wordwrapinfo(int offset, const char *m) { while (l && isspace(m[l-1])) l--; if (!l || (*m == '.' && l == 1)) { if (wrapping) waddch(infopad,'\n'); - waddch(infopad,'\n'); - wrapping= 0; + waddch(infopad, '\n'); + wrapping = false; } else if (*m == ' ' || usemax < 10) { if (wrapping) waddch(infopad,'\n'); waddnstr(infopad, m, l); - waddch(infopad,'\n'); wrapping= 0; + waddch(infopad, '\n'); + wrapping = false; } else { int x, y DPKG_ATTR_UNUSED; @@ -354,7 +356,7 @@ void baselist::wordwrapinfo(int offset, const char *m) { if (l <= 0) break; waddch(infopad,'\n'); } - wrapping= 1; + wrapping = false; } if (!p) break; if (getcury(infopad) == (MAX_DISPLAY_INFO - 1)) { |