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

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

    <bug>
          <bug_id>24251</bug_id>
          
          <creation_ts>2010-10-09 15:58:25 +0400</creation_ts>
          <short_desc>False positive &quot;Unterminated quoted string&quot; error</short_desc>
          <delta_ts>2010-10-12 20:10:13 +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>checkbashisms</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sergey Kurakin">kurakin</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>113367</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey Kurakin">kurakin</who>
    <bug_when>2010-10-09 15:58:25 +0400</bug_when>
    <thetext>Скрипт i2myspell из одноименного пакета:

$ checkbashisms /usr/bin/i2myspell
possible bashism in /usr/bin/i2myspell line 61 ([^] should be [!]):
s/\([^ ]*\).&gt;.\([^,]*\)$/0 \2 \1/
possible bashism in /usr/bin/i2myspell line 62 ([^] should be [!]):
s/\([^ ]*\).&gt;.-\([^,]*\),\(\-\)$/\2 0 \1/
possible bashism in /usr/bin/i2myspell line 63 ([^] should be [!]):
s/\([^ ]*\).&gt;.-\([^,]*\),\(.*\)$/\2 \3 \1/&apos; |
error: /usr/bin/i2myspell: Unterminated quoted string found, EOF reached. Wanted: &lt;&apos;&gt;

Удалось выяснить, что ошибка с определением закрывающей кавычки происходит на строке 46 проверяемого скрипта, а всё остальное -- это уже последствия.

Ошибочно распознаваемая конструкция выглядит так:

sed &apos;s#/# #g
s# #/#&apos;

Запись конструкции в одну строку (sed &apos;s#/# #g;s# #/#&apos;) проблемы не решает. Зато проблема решается заменой &quot;#&quot; на любой другой разделитель. Причем, достаточно заменить &quot;#&quot; только во втором шаблоне:

sed &apos;s#/# #g
s| |/|&apos;

Такая конструкция проблем не вызывает и проверяется успешно.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113607</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2010-10-12 17:38:19 +0400</bug_when>
    <thetext>Если вы оформите предложение по исправлению checkbashisms в виде патча сюда и/или в mainstream, то я смогу его применить в новой сборке пакета.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113618</commentid>
    <comment_count>2</comment_count>
      <attachid>4607</attachid>
    <who name="Sergey Kurakin">kurakin</who>
    <bug_when>2010-10-12 20:06:41 +0400</bug_when>
    <thetext>Created attachment 4607
checkbashisms fails on this script</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113619</commentid>
    <comment_count>3</comment_count>
      <attachid>4608</attachid>
    <who name="Sergey Kurakin">kurakin</who>
    <bug_when>2010-10-12 20:08:32 +0400</bug_when>
    <thetext>Created attachment 4608
checkbashisms processes this script successfully</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113620</commentid>
    <comment_count>4</comment_count>
    <who name="Sergey Kurakin">kurakin</who>
    <bug_when>2010-10-12 20:10:13 +0400</bug_when>
    <thetext>Был бы патч -- не было бы вопросов. Пока могу предоставить только testcase.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4607</attachid>
            <date>2010-10-12 20:06:41 +0400</date>
            <delta_ts>2010-10-12 20:06:41 +0400</delta_ts>
            <desc>checkbashisms fails on this script</desc>
            <filename>checkbashisms_fail</filename>
            <type>application/octet-stream</type>
            <size>49</size>
            <attacher name="Sergey Kurakin">kurakin</attacher>
            
              <data encoding="base64">IyEvYmluL3NoCmVjaG8gc29tZXRoaW5nIHwgc2VkICcKcyMvIyNnCnMjICMvIycKCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4608</attachid>
            <date>2010-10-12 20:08:32 +0400</date>
            <delta_ts>2010-10-12 20:08:32 +0400</delta_ts>
            <desc>checkbashisms processes this script successfully</desc>
            <filename>checkbashisms_success</filename>
            <type>application/octet-stream</type>
            <size>49</size>
            <attacher name="Sergey Kurakin">kurakin</attacher>
            
              <data encoding="base64">IyEvYmluL3NoCmVjaG8gc29tZXRoaW5nIHwgc2VkICcKcyMvIyNnCnN8IHwvfCcKCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>