WG15 Defect Report Ref: 9945-2-05
Topic: dd

This is an approved interpretation of 9945-2:1993.


Last update: 1997-05-20

	Class: No change


	Topic:			dd
	Relevant Sections:	4.16.2

Defect Report:
          In Section 4.16.2 - Description {of dd}, the standard states 
               (2)  If  the  input  block  is  shorter  than  the 
                    specified  input  block  size  and  the  sync 
                    conversion is specified, null bytes shall  be 
                    appended  to  the  input  data  up   to   the 
                    specified size. (If either block  or  unblock 
                    is also specified, <space>  characters  shall 
                    be appended  instead  of  null  bytes.)   The 
                    remaining  conversions   and   output   shall 
                    include the pad characters  as  if  they  had 
                    been read from the input. 
               (6)  The data resulting from input  or  conversion 
                    or  both  shall  be  aggregated  into  output 
                    blocks of the specified size.  After the  end 
                    of input is  reached,  any  remaining  output 
                    shall be written as a block  without  padding 
                    if conv=sync  is  not  specified;  thus,  the 
                    final output block may be  shorter  than  the 
                    output block size. 
          [Draft 12 of ISO/IEC 9945-2:1993 (July 1992), p. 257, lines 
          3063-3068, 3079-3083] 
          In Section 4.16.4 - Operands  {of  dd},  the  various  conv= 
          conversions are specified: 
               block Treat   the   input   as   a   sequence   of 
                    <newline>-terminated     or      end-of-file- 
                    terminated    variable     length     records 
                    independent of the  input  block  boundaries. 
                    Each record shall be converted  to  a  record 
                    with  a  fixed  length   specified   by   the 
                    conversion block size.  Any  <newline>  shall 
                    be removed  from  the  input  line;  <space>s 
                    shall be appended to lines that  are  shorter 
                    than their conversion block size to fill  the 
                    block.   Lines  that  are  longer  than   the 
                    conversion block size shall be  truncated  to 
                    the largest number of  characters  that  will 
                    fit into that size; the number  of  truncated 
                    lines shall be reported (see  Standard  Error 
               sync Pad every input block to the size of the ibs= 
                    buffer,  appending  null  bytes.   If  either 
                    block or unblock is  also  specified,  append 
                    <space> characters, rather than null bytes. 
          [Ibid., pp. 259-260, lines 3125-3135, 3164-3166] 
          The standard does not specify what happens to the output  if 
          the conv=sync conversion is specified, most notably  in  the 
          case when conv=block is also  specified.   Does  the  output 
          block get padded with <space> characters in this case, or is 
          no output padding done?  The  definition  of  the  conv=sync 
          conversion does not  describe  output  buffering;  the  only 
          reference to it is on page 258, cited above. 

WG15 response for 9945-2:1993 
The descriptions of conv=sync and conv=block are clear and orthogonal,
conv=sync referring to input only and conv=block to output only. Hence,
specifying conv=sync has no effect on how output is handled, other than
its specific role in modifying input.

Rationale for Interpretation: