<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>11492</bug_id>
          
          <creation_ts>2007-04-12 20:05:28 +0400</creation_ts>
          <short_desc>/usr/bin/tac некорректно выводит файл с отсутствующим carriadge return в конце файла</short_desc>
          <delta_ts>2008-08-30 16:13:17 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>coreutils</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Kornilov">hiddenman</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>php-coder</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48736</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Kornilov">hiddenman</who>
    <bug_when>2007-04-12 20:05:28 +0400</bug_when>
    <thetext>Если в файле содержится больше одной строки и в конце последней строки нет
символа &quot;возврата каретки&quot;, то tac выводит последние две строки как одну.
В coreutils 6.9, судя по diff между старым и новым tac.c, это тоже воспроизводится.
Steps to Reproduce:
1.echo first &gt;&gt;testfile
2.echo second &gt;&gt;testfile
3.echo -n third &gt;&gt;testfile
4. tac testfile
Actual Results:  
thirdsecond
first


Expected Results:  
third
second
first</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50461</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Kornilov">hiddenman</who>
    <bug_when>2007-05-21 02:55:00 +0400</bug_when>
    <thetext>Из-за этого &quot;бага&quot; в etcnet будут некорректно обрабатываться файлы
ipv[46]rule,route и правила *tables при &quot;остановке&quot;, если нет символа перевода
строки в последней строке.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50530</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2007-05-21 18:24:08 +0400</bug_when>
    <thetext>Я не знаю, это bug или нет.
Напишите, пожалуйста, на bug-coreutils@gnu.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66419</commentid>
    <comment_count>3</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2008-03-23 03:59:52 +0300</bug_when>
    <thetext>Я считаю, что это баг.  Если tac(1) читает построчно, то выводить тоже должен
построчно.  Склейка последней и предпоследней строк в одну строку в случае no
newline at EOF явно противоречит идее &quot;построчно&quot;.

По аналогии можно, рассмотрим работу sort(1):
$ printf &apos;B\nA&apos; |sort
A
B
$

Если бы sort(1) вывел &quot;AB&quot;, то это был бы номер.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66420</commentid>
    <comment_count>4</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2008-03-23 04:25:05 +0300</bug_when>
    <thetext>Вариант согласования с документацией &apos;info tac&apos;:
если встречаем EOF без окончательно сепаратора, то такой EOF сам по себе канает
за сепаратор.  В противном случае два последних records -- последний и
предпоследний -- безвозвратно склеиваются, что вряд ли логично.

$ echo -n a:b:c |tac -b --separator=: 
:c:ba$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76668</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2008-08-30 16:13:17 +0400</bug_when>
    <thetext>Я не готов трактовать это поведение как ошибочное,
Изложите, пожалуйста, вашу точку зрения на bug-coreutils@gnu.org</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>