use better patch from ubuntu
authorgregor herrmann <gregoa@debian.org>
Fri, 20 Jun 2008 14:12:33 +0000 (14:12 -0000)
committergregor herrmann <gregoa@debian.org>
Fri, 20 Jun 2008 14:12:33 +0000 (14:12 -0000)
debian/changelog
debian/patches/02_segfault_longoptions.patch

index 59cae37a0bdb9940c3d7caa56ad9fc4920d9b316..0a455f41df3e1095adfbb9f98a1ea981fd8824f6 100644 (file)
@@ -15,8 +15,8 @@ cpulimit (1.1-11) unstable; urgency=low
   * Set debhelper compatibility level to 6.
   * Switch patch system from dpatch to quilt.
   * Add patch 02_segfault_longoptions.patch; fixes segfault with long
-    "--limit" option (closes: #487233, LP: #241538). Thanks to Daniel van
-    Eeden for reporting the problem.
+    options (closes: #487233, LP: #241538). Thanks to Daniel van
+    Eeden for reporting the problem and to Cesare Tirabassi for the patch.
   * debian/watch: use sourceforge URL directly instead of the redirector at
     qa.debian.org.
 
index 9f9863ac09fedbffbed69d010ae187e47b3ccb60..ee21484817bef2fd2ea819b40ea4b2368e1be2ee 100644 (file)
@@ -1,15 +1,27 @@
-Author: gregor herrmann <gregoa@debian.org>
-Description: make "limit" a required_argument; fixes segfault
-Bug: #487233
+Author: Cesare Tirabassi <norsetto@ubuntu.com>
+Description: Fix long options list of arguments.
+Bugs: #487233, #487236, LP #241538
 
 --- cpulimit-1.1.orig/cpulimit.c
 +++ cpulimit-1.1/cpulimit.c
-@@ -363,7 +363,7 @@
-               { "pid", 0, NULL, 'p' },
-               { "exe", 1, NULL, 'e' },
-               { "path", 0, NULL, 'P' },
+@@ -360,13 +360,13 @@
+       const char* short_options="p:e:P:l:vzh";
+       /* An array describing valid long options. */
+       const struct option long_options[] = {
+-              { "pid", 0, NULL, 'p' },
+-              { "exe", 1, NULL, 'e' },
+-              { "path", 0, NULL, 'P' },
 -              { "limit", 0, NULL, 'l' },
-+              { "limit", 1, NULL, 'l' },
-               { "verbose", 0, NULL, 'v' },
-               { "lazy", 0, NULL, 'z' },
-               { "help", 0, NULL, 'h' },
+-              { "verbose", 0, NULL, 'v' },
+-              { "lazy", 0, NULL, 'z' },
+-              { "help", 0, NULL, 'h' },
++              { "pid", required_argument, NULL, 'p' },
++              { "exe", required_argument, NULL, 'e' },
++              { "path", required_argument, NULL, 'P' },
++              { "limit", required_argument, NULL, 'l' },
++              { "verbose", no_argument, NULL, 'v' },
++              { "lazy", no_argument, NULL, 'z' },
++              { "help", no_argument, NULL, 'h' },
+               { NULL, 0, NULL, 0 }
+       };
+       //argument variables