fix the -m option

This commit is contained in:
Matthias Clasen 2007-08-16 01:27:11 +00:00
parent c6f098b8d9
commit 627958eda7
2 changed files with 31 additions and 1 deletions

View File

@ -1,9 +1,11 @@
Summary: Utilities for manipulating .desktop files
Name: desktop-file-utils
Version: 0.13
Release: 2%{?dist}
Release: 3%{?dist}
URL: http://www.freedesktop.org/software/desktop-file-utils
Source0: http://www.freedesktop.org/software/desktop-file-utils/releases/%{name}-%{version}.tar.gz
# https://bugs.freedesktop.org/show_bug.cgi?id=12018
Patch0: short-option.patch
License: GPLv2+
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -23,6 +25,7 @@ fixing it up in the process.
%prep
%setup -q
%patch0 -p1 -b .short-option
%build
%configure
@ -42,6 +45,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/emacs/site-lisp/
%changelog
* Wed Aug 15 2007 Matthias Clasen <mclasen@redhat.com> - 0.13-3
- Make the -m option work (#232761)
* Mon Aug 6 2007 Matthias Clasen <mclasen@redhat.com> - 0.13-2
- Update license field

24
short-option.patch Normal file
View File

@ -0,0 +1,24 @@
diff -up desktop-file-utils-0.13/src/install.c.short-option desktop-file-utils-0.13/src/install.c
--- desktop-file-utils-0.13/src/install.c.short-option 2007-08-15 21:14:57.000000000 -0400
+++ desktop-file-utils-0.13/src/install.c 2007-08-15 21:17:06.000000000 -0400
@@ -430,7 +430,9 @@ parse_options_callback (const gchar *op
GError **error)
{
/* skip "--" */
- option_name += 2;
+ option_name++;
+ if (*option_name == '-')
+ option_name++;
if (strcmp (OPTION_VENDOR, option_name) == 0)
{
@@ -480,7 +482,8 @@ parse_options_callback (const gchar *op
g_strdup (value));
}
- else if (strcmp (OPTION_MODE, option_name) == 0)
+ else if (strcmp (OPTION_MODE, option_name) == 0 ||
+ strcmp ("m", option_name) == 0)
{
unsigned long ul;
char *end;