Bug 90724 - Appending categories fails if no ";" is present
Summary: Appending categories fails if no ";" is present
Alias: None
Product: Fedora
Classification: Fedora
Component: desktop-file-utils
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Dan Williams
QA Contact:
Depends On:
Blocks: CambridgeTarget
TreeView+ depends on / blocked
Reported: 2003-05-12 22:08 UTC by Adrian Reber
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2004-08-12 13:30:14 UTC
Type: ---

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

Description Adrian Reber 2003-05-12 22:08:51 UTC
Categories are not appended in a right way if the Categories 
key does not end with ";":

Original line:


After adding a category:


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 22:13:32 UTC
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 22:31:28 UTC
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.


Comment 3 Adrian Reber 2003-05-12 22:34:32 UTC
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

Another possible solution would be to change the function


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 19:45:54 UTC
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:

Comment 5 Warren Togami 2004-08-02 06:14:42 UTC
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 09:10:25 UTC
Warrent: NEEDINFO doesn't make sense - what information are you
looking for from the reporter?

Comment 7 Warren Togami 2004-08-03 09:26:08 UTC
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 09:44:56 UTC
I have created a SRPM containing the patch based on the latest FC1


Comment 9 Dan Williams 2004-08-11 15:39:54 UTC
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 15:40:21 UTC
Make that "fixed in FC2 and FC3"

Comment 11 Dan Williams 2004-08-12 13:30:14 UTC
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.