View Issue Details

IDProjectCategoryView StatusLast Update
00015231003.1(2016/18)/Issue7+TC2System Interfacespublic2024-06-11 09:07
Reporterrillig Assigned To 
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted As Marked 
NameRoland Illig
Organization
User Reference
SectionDESCRIPTION
Page Number(page or range of pages)
Line Number(Line or range of lines)
Interp Status---
Final Accepted Text0001523:0005599
Summary0001523: Wrong layout of getopt "-"
Description> If, when getopt() is called:
>
> argv[optind] is a null pointer*argv[optind] is not the character -
> argv[optind] points to the string "-"

I didn't understand the above excerpt, even after reading it multiple times.

My misunderstanding was due to the missing line break before the first '*' and by the additional space before the last line.
Desired ActionChange the rendered HTML text to be:

> If, when getopt() is called:
>
> argv[optind] is a null pointer
> argv[optind][0] is not the character '-'
> argv[optind] points to the string "-"

The changes are:
* additional line break between line 1 and line 2
* postfix array index in line 2 to make the lines look more similar
* single quotes around the character '-' in line 2
* no leading space in line 3

Having the HTML markup <tt> inside of
 looks strange, as if the text outside the <tt> was intended to be displayed in proportional font. That may or may not be an entirely different issue though.

While here, I'd prefer it if at the end of the
 sections, there were no additional newline, so that the continuation of the sentence "getopt() shall return -1" is closer to the list of conditions.
Tagstc3-2008

Activities

rillig

2021-10-09 14:52

reporter   bugnote:0005499

I just saw that Mantis didn't render the description as intended, so here is my second try, after reading the provided documentation that answered exactly my questions. :)

Change the rendered HTML text to be:

> If, when getopt() is called:
>
> argv[optind] is a null pointer
> argv[optind][0] is not the character '-'
> argv[optind] points to the string "-"

The changes are:
* additional line break between line 1 and line 2
* postfix array index in line 2 to make the lines look more similar
* single quotes around the character '-' in line 2
* no leading space in line 3

Having the HTML markup <tt> inside of <_pre> looks strange, as if the text outside the <tt> was intended to be displayed in proportional font. That may or may not be an entirely different issue though.

While here, I'd prefer it if at the end of the <_pre> sections, there were no additional newline, so that the continuation of the sentence "getopt() shall return -1" is closer to the list of conditions.

kre

2021-10-09 16:20

reporter   bugnote:0005500

Last edited: 2021-10-09 16:25

Of those proposed changes, the missing newline is clearly a
rendering into HTML issue, it isn't like that in the PDF version,
and should be easily fixed (says me who knows nothing about that process!)

The changes from *argv[optind] to argv[optind][0] and to put
quotes areound the minus sign on that line would require changes to
the PDF as well, and so need to be a bug report (editorial) against
issue7-TC2 - the first of those I see no point for, it is fine as it is
(when correctly rendered, as in the PDF), the second just maybe (it
is clear enough as it is, but single quotes wouldn't hurt).

The leading space in line 3 should also occur in line 1, and serves to
cause the three instances of argv[optind] to line up one above the other
(the 2nd line has the '*' in that position), and I see no reason to change
that either. In the HTML those should perhaps be &nbsp; rather than
just a space.

The blank line after the conditions also matches the PDF, and I see no
issue with that either.

One thing I might alter, if editorial (as aside from just rendering)
changes are considered, is to make it explicit that the three conditions
are "any of" choices, not "all of" (even though it is obvious that the
latter cannot possibly be intended upon careful reading), perhaps by
changing "If, when getopt() is called:" to "If, when getopt() is called any of:"
(to avoid needing to insert "or" somewhere, which would look ugly).

geoffclare

2022-01-13 16:48

manager   bugnote:0005599

Two-part resolution:
    
1. Action on Andrew to change the HTML translation so it better resembles the PDF

2. In the next update to the standard (PDF/troff), make the following changes:
    
On page 1061 line 36094 section getopt(), change:
If, when getopt( ) is called:
to:
If, when getopt( ) is called, any of the following is true:

On page 1061 line 36096 section getopt(), change:
is not the character −
to:
is not the character '−'

ajosey

2022-01-14 18:07

manager   bugnote:0005608

The html edition has been updated both online and in gitlab, the bundles have been updated.

Issue History

Date Modified Username Field Change
2021-10-09 14:42 rillig New Issue
2021-10-09 14:42 rillig Name => Roland Illig
2021-10-09 14:42 rillig URL => https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
2021-10-09 14:42 rillig Section => DESCRIPTION
2021-10-09 14:52 rillig Note Added: 0005499
2021-10-09 16:20 kre Note Added: 0005500
2021-10-09 16:23 kre Note Edited: 0005500
2021-10-09 16:25 kre Note Edited: 0005500
2022-01-13 16:48 geoffclare Note Added: 0005599
2022-01-13 16:52 geoffclare Project Online Pubs => 1003.1(2016/18)/Issue7+TC2
2022-01-13 16:52 geoffclare Page Number => (page or range of pages)
2022-01-13 16:52 geoffclare Line Number => (Line or range of lines)
2022-01-13 16:52 geoffclare Interp Status => ---
2022-01-13 16:52 geoffclare Final Accepted Text => 0001523:0005599
2022-01-13 16:52 geoffclare Status New => Resolved
2022-01-13 16:52 geoffclare Resolution Open => Accepted As Marked
2022-01-13 16:52 geoffclare Tag Attached: tc3-2008
2022-01-14 18:07 ajosey Note Added: 0005608
2022-02-04 10:07 geoffclare Status Resolved => Applied
2024-06-11 09:07 agadmin Status Applied => Closed