bugGNU gettext - Bugs: bug #30741, gettextlib accepts comments that...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #30741: gettextlib accepts comments that break PO files

Submitted by:  None
Submitted on:  Wed 11 Aug 2010 02:05:23 AM UTC  
 
Category:  Other Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  Miguel Ángel Arruga Vivas <m1gu3l>
Open/Closed:  Closed

Tue 05 Mar 2013 02:54:51 AM UTC, comment #4:

Closing this because we can't handle it without proper escaping rule in the comment syntax and hopefully it would be easy to check if the comment string ends with a backslash in the caller side.

Daiki Ueno <ueno>
Project Administrator
Sun 03 Mar 2013 10:13:49 AM UTC, comment #3:

Saturday night patches always need reviewing. Thank you, Daiki. :)

Also comments are welcome, it may not be a bug, because that kind of backslash it is too picky to be real.

(file #27559)

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Sun 03 Mar 2013 07:56:02 AM UTC, comment #2:

Well, the patch looks not correct.

+ memcpy (".", buffer + length, 2);

memcpy's first argument is the destination, not source.

Also I wonder if we can silently modify the supplied comment like that...

Daiki Ueno <ueno>
Project Administrator
Sun 03 Mar 2013 01:49:07 AM UTC, comment #1:

The attached patch is a proposal for testing.

(file #27555)

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Wed 11 Aug 2010 02:05:23 AM UTC, original submission:

po_message_set_extracted_comments("A comment\\")

Or

po_message_set_comments("A comment\\")

Will create a PO message like this:

# Something \
msgid "One"
msgstr "Een"

msgfmt -cv x.po
Causes this error:
x.po:3:7: syntax error

Problem
=======
gettextlib accepts input that creates broken PO files without complaint.

Solution
========
1) Warn about broken input - not ideal as then tools need to manage checking for broken input
2) Escape \ at the end of the line or pad it with a single space.

Anonymous

 

Attached Files
file #27559:  gettextpo.patch added by m1gu3l (2KiB - text/x-patch)
file #27555:  gettextpo.patch added by m1gu3l (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by m1gu3l (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-27 haible CategoryNone => Other
        StatusNot a Bug => Wont Fix
    2013-03-05 ueno Open/ClosedOpen => Closed
    2013-03-04 m1gu3l StatusReady For Test => Not a Bug
    2013-03-03 m1gu3l Attached File- => Added gettextpo.patch, #27559
    2013-03-03 m1gu3l Attached File- => Added gettextpo.patch, #27555
        StatusNone => Ready For Test
        Assigned toNone => m1gu3l

    Back to the top


    Powered by Savane 3.3