User account creation filtered due to spam.

Bug 31377 - wrap_help error
Summary: wrap_help error
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.2
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2007-03-27 18:43 UTC by George Ellery
Modified: 2012-02-01 23:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Ellery 2007-03-27 18:43:47 UTC
in the file "opts.c", in the function "wrap_help", the var 'room' is calculated as the space remaining between the the left item field width and the rightmost column (which defaults to 80 chars). it is then compared to the columns value:

      room = columns - 3 - MAX (col_width, item_width);
      if (room > columns)
    	room = 0;
      len = remaining;

I assume this is supposed to determine if the left field is taking up more than the entire width of the line and if so, sets it to 0 as there is no room left. 
to do this, the correct code should be

      room = columns - 3 - MAX (col_width, item_width);
      if (room < 0)
    	room = 0;
      len = remaining;

admitedly, since all the help lines that print out don't have a left field that comes close to taking up the entire line, this case never occurs, so this is a trival case.