mirror of
https://github.com/curl/curl.git
synced 2026-05-17 15:16:21 +03:00
parent
f12a81de4f
commit
69622ff37d
1 changed files with 6 additions and 2 deletions
|
|
@ -87,14 +87,18 @@ static void print_category(unsigned int category, unsigned int cols)
|
|||
if(len > longdesc)
|
||||
longdesc = len;
|
||||
}
|
||||
if(longopt + longdesc > cols)
|
||||
|
||||
if(longdesc > cols)
|
||||
longopt = 0; /* avoid wrap-around */
|
||||
else if(longopt + longdesc > cols)
|
||||
longopt = cols - longdesc;
|
||||
|
||||
for(i = 0; helptext[i].opt; ++i)
|
||||
if(helptext[i].categories & category) {
|
||||
size_t opt = longopt;
|
||||
size_t desclen = strlen(helptext[i].desc);
|
||||
if(opt + desclen >= (cols - 2)) {
|
||||
/* avoid wrap-around */
|
||||
if(cols >= 2 && opt + desclen >= (cols - 2)) {
|
||||
if(desclen < (cols - 2))
|
||||
opt = (cols - 3) - desclen;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue