|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 0725 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 0725.
Report 0725 Actions
Problem Report Number 0725 Submitter's Classification Specification problem State Resolved Resolution Withdrawn (WDN) Problem Resolution ID WDN.X.0022 Raised 1970-01-01 07:00 Updated 2005-07-22 00:47 Published 2005-07-22 00:47 Product Standard Commands and Utilities V2 (UNIX 95) Certification Program The Open Brand certification program Test Suite VSC version 4.1.5 Test Identification POSIX.cmd/pr 18,20 Specification Commands and Utilities Issue 4 Version 2 Location in Spec See Problem Text Problem Summary TIN4C.00045 This test may fail on implementations because of a grey area
in the treatment of adjacent space.Problem Text This test may fail on implementations because of a grey area in the
treatment of adjacent space.
The assertions in question test the semantics of the -i[char][gap]
option to the pr utility. Both of these tests were changed from
VSC4.1.4 to VSC4.1.5 based on a waiver request that was accepted as
TSD4C.00086. In our view, that request was clearly in error and
should
not have been granted. This TSD says, in part:
For the case of 6*gap+1, which is position 25, and 15*gap+1,
which is position 61, the test expects space replacement
to occur
at these positions. In the case of tp20 it is an X and
in the
case of tp18 it is a tab character. It should not
expect any
space replacement at these points because there is only one
^^^^^^^^^^^^^^^^^
adjacent space to these column positions in both cases.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is simply not true. There is only one adjacent space to
the left
of the specified column, but the standard makes no distinction
in this
regard. The test in VSC4.1.4 expected tab replacement for the five
adjacent spaces at 7*gap+1 and the nine adjacent spaces at 17*gap+1.
(See TSD4C.00086 for a description of the input files.)
Incidentally,
this is also the historical behavior of the pr utility.
We have submitted a request for a POSIX.2 interpretation on this
issue. The text of this interpretation request is attached, and
gives our reasoning. Until this interpretation is available, we
request a waiver on the grounds that this is a grey area in the
specification.
------------------start of POSIX.2 interpretation
request---------------
Dear Interpretations Committee,
I would like to request an official binding interpretation of IEEE
Std 1003.2-1992 (POSIX.2). This request deals with the semantics
of the "-i" option to the "pr" utility. These semantics are
specified
in POSIX.2 subclause 4.49.3 lines 8037-8043, which state (in part):
-i[char][gap]
In output, replace multiple <space>s with <tab>s
wherever two or more adjacent <space>s reach
column positions gap + 1, 2 x gap + 1, 3 x gap + 1,
etc. If gap is zero or is omitted, default <tab>
settings at every eighth column position shall be
assumed.
The issue that I would like addressed is the following: If an
input line contains a space at position (n x gap + 1) followed by
n consecutive spaces, should the output file contain a single
space at position (n x gap + 1) followed by a single tab, or
should it contain two tabs? An example may make this clearer.
Suppose that "inputfile" contains the following two lines
1234567890 This line shows column positions
123 90
(five consecutive spaces, no tabs, in the second line) and
suppose that the command
pr -i4 inputfile
is issued. Should the output generated by the second line
be
123 ^I90
or
123^I^I90
Here ^I stands for a tab.
I contend that the second output is correct (or that, at best,
the standard is ambiguous). To support this, note that the five
consecutive spaces reach column position 9 = (2 x 4 + 1), and
therefore (according to the specification) should all be replaced
by tabs. The fact that the first of these spaces is at a tab
position does not seem relevant and is not addressed in the
standard.
Thank you for your attention to this matter.
-------------------end of POSIX.2 interpretation
request----------------
Test Output -----------------start of test output------------------
520|244 1 9964 1 1|Assertion #18 (A): Test the -i[gap] option
520|244 1 9964 1 11|Command failed: 'cmp -s pr_eso_18_1 pr_eso_18_2'
220|244 1 1 16:03:21|FAIL
410|244 18 1 16:03:21|IC End
520|244 1 9964 1 1|Assertion #20 (A): Test the -i[char][gap] option
520|244 1 9964 1 11|Command failed: 'cmp -s pr_eso_20_1 pr_out_20_2'
220|244 1 1 16:03:24|FAIL
410|244 20 1 16:03:24|IC End
------------------end of test output-------------------Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response The standard is not clear whether the two or more adjacent
spaces rule applies to the greatest number of contiguous spaces
prior to a defined column position (x*gap+1), or only spaces between
each defined column position (x*gap+1 and (x+1)*gap+1):
In output, replace multiple <space>s with <tab>s
wherever two or more adjacent <space>s reach
column positions gap + 1, 2 x gap + 1, 3 x gap + 1,
etc. If gap is zero or is omitted, default <tab>
Consider the example again.
1234567890 This line shows column positions
123 90
Either the rule applies to the single space at column 4 and columns
5-8 separately, or the rule applies to all the spaces between 4
and 8.
In the former case, the single space remains and the second block is
turned into a tab. In the latter case, the entire block of spaces
is turned into two tabs, one for each column position (x*gap+1)
reached.
Pending the outcome of the POSIX.2 interpretation filed, a temporary
interpretation is recommended.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Temporary Interpretation (TIN) Review Conclusion A Temporary Interpretation is granted.
Problem Reporting System Options:
- View Report 0725
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority