Bug 90724

Summary: Appending categories fails if no ";" is present
Product: [Fedora] Fedora Reporter: Adrian Reber <adrian>
Component: desktop-file-utilsAssignee: Dan Williams <dcbw>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 1CC: scop, wtogami
Target Milestone: ---Keywords: EasyFix, Patch, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-12 13:30:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 100644    
Attachments:
Description Flags
patch to cope with lines without ";" at the end none

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:

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 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>

	* 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 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
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 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:
http://freedesktop.org/pipermail/xdg/2004-July/004187.html

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
version:

http://lisas.de/~adrian/rpm/desktop-file-utils-0.3-10.src.rpm

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.