After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 163689 - intltool-extract misbehaves on empty "msgid"s
intltool-extract misbehaves on empty "msgid"s
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on: 160262
Blocks:
 
 
Reported: 2005-01-11 15:48 UTC by Miloslav Trmac
Modified: 2005-01-21 02:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow empty msgids in XML (1.01 KB, patch)
2005-01-11 15:49 UTC, Miloslav Trmac
none Details | Review
Add a test case for empty msgids in XML (1.56 KB, patch)
2005-01-11 22:59 UTC, Miloslav Trmac
none Details | Review

Description Miloslav Trmac 2005-01-11 15:48:47 UTC
intltool-extract on XML assumes that "message ids" are nonempty, which
causes strange behavior in cases like this:

<comps>
<_name>Normal name</_name>
<_name></_name>
<_name>Other name</_name>
</comps>

This would result in finding two msgids, "Normal name" and
"</_name>\n<_name>Other name".

The attached patch (against current CVS as of Jan 11 2005) allows empty msgids
for XML, like when processing other file types. This does no harm because such
strings are not written out to the .h file anyway.
There were no testsuite regressions with this patch.
Comment 1 Miloslav Trmac 2005-01-11 15:49:24 UTC
Created attachment 35835 [details] [review]
Allow empty msgids in XML
Comment 2 Danilo Segan 2005-01-11 19:44:24 UTC
Miloslav, thanks for the patch.  Though, I plan to switch intltool-extract over
to XML::Parser as well, so this will be automatically fixed (see bug #160262). 
What would be nice is adding a test case for this behaviour, so we don't
introduce regressions later on. Care to handle that one? :)

As for the problem, where did you come across this?
Comment 3 Miloslav Trmac 2005-01-11 22:59:49 UTC
Created attachment 35860 [details] [review]
Add a test case for empty msgids in XML

This should be enough.
Apparently the code for attributes handles empty msgids correctly (by
ignoring them), I never tested that before.

In real life this happened in practice in Fedora comps (package groups),
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143751
Comment 4 Rodney Dawes 2005-01-21 02:05:57 UTC
I've committed both of these patches with appropriate crediting in the ChangeLog
to Miloslav. The patches look good, and the test case works properly. It
shouldn't be much of an issue to update the patch for converting to XML::Parser
for this change, since the 2 lines are being removed in it anyway. :)