Bug 90724 - Appending categories fails if no ";" is present
Appending categories fails if no ";" is present
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: desktop-file-utils (Show other bugs)
1
All Linux
medium Severity low
: ---
: ---
Assigned To: Dan Williams
: EasyFix, Patch, Triaged
Depends On:
Blocks: CambridgeTarget
  Show dependency treegraph
 
Reported: 2003-05-12 18:08 EDT by Adrian Reber
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-12 09:30:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to cope with lines without ";" at the end (633 bytes, patch)
2003-05-12 18:13 EDT, Adrian Reber
no flags Details | Diff

  None (edit)
Description Adrian Reber 2003-05-12 18:08:51 EDT
Categories are not appended in a right way if the Categories 
key does not end with ";":

Original line:

Categories=Qt;KDE;AudioVideo

After adding a category:

Categories=Qt;KDE;AudioVideoSystem;

If the value does end with a ";" the new category is handled correctly.

I have created a patch which fixes this problem by checking if the
string does end with a ";" and if not a ";" is appended before the 
new category is added.

I will add my patch.
Comment 1 Adrian Reber 2003-05-12 18:13:32 EDT
Created attachment 91633 [details]
patch to cope with lines without ";" at the end 

I am not 100% sure about the patch and if it the right position.
It did work with the small tests I did but it can be possible
that this interferes with other stuff as I only have tested
it with the categories problem.
Comment 2 Havoc Pennington 2003-05-12 18:31:28 EDT
Fixed in CVS:

2003-05-12  Havoc Pennington  <hp@redhat.com>

	* src/validate.c: fix a bunch of compiler warnings
	(desktop_file_fixup): add code to fix semicolon termination of
	string lists if necessary.

	* src/desktop_file.c (gnome_desktop_file_merge_string_into_list):
	handle case where existing list is missing ';' at the end; 
	patch from Adrian Reber

If you want to test the CVS fixes (which would be appreciated), 
you can get them from anoncvs, see
http://www.freedesktop.org/about/involved.html (module desktop-file-utils)

anoncvs syncs once per hour so the above change may take up to an hour to appear.

Thanks
Comment 3 Adrian Reber 2003-05-12 18:34:32 EDT
I did test the patch a bit more and it does not fix the problem
if the --remove-category is used with the same problem as described
above.

Another possible solution would be to change the function

gnome_desktop_file_get_raw()

to always append a ";" to a string if not present. But as this function
is used in many places I am not sure if this would be a good idea.

Thanks for the link to the CVS repository.
Comment 4 Ville Skyttä 2004-07-08 15:45:54 EDT
RHL 9 is long gone, but FC1 is still affected and "supported" in some
sense.  Would it be possible to release an FC1 erratum for this bug?

By the way, the --remove-category seems issue seems unrelated, and
there are some bugs in it even in fd.o CVS HEAD:
http://freedesktop.org/pipermail/xdg/2004-July/004187.html
Comment 5 Warren Togami 2004-08-02 02:14:42 EDT
Please prepare a suggested SRPM based upon the original FC1 package
for potential FC1 update.  I will try to get a desktop team member to
review & push it.
Comment 6 Mark McLoughlin 2004-08-03 05:10:25 EDT
Warrent: NEEDINFO doesn't make sense - what information are you
looking for from the reporter?
Comment 7 Warren Togami 2004-08-03 05:26:08 EDT
He wanted a change done, and he is one of the trusted Fedora Extras
packagers, so if he really wants this to happen he can supply the
suggested package for your review.  Your time is better used not
dealing with this.
Comment 8 Adrian Reber 2004-08-03 05:44:56 EDT
I have created a SRPM containing the patch based on the latest FC1
version:

http://lisas.de/~adrian/rpm/desktop-file-utils-0.3-10.src.rpm
Comment 9 Dan Williams 2004-08-11 11:39:54 EDT
Fixed in FC1 and FC3 due to revs, package going into FC1 updates today
(will be desktop-file-utils-0.3-10.1)
Comment 10 Dan Williams 2004-08-11 11:40:21 EDT
Make that "fixed in FC2 and FC3"
Comment 11 Dan Williams 2004-08-12 09:30:14 EDT
Pushed to FC1 updates.  Please reopen if the update does not appear in
a day or two.

Note You need to log in before you can comment on or make changes to this bug.