[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#217036: autopartkit: suggested patch



On Wed, 22 Oct 2003 15:29:06 +0200
"Finn-Arne Johansen" <faj@bzz.no> wrote:

> Package: autopartkit
> Version: N/A; reported 2003-10-22
> Followup-For: Bug #217036
> 
> suggested patch included

It seem like the attachement disappered (reportbug is playing with me?) 

I'm resending the patch.

-- 
Finn-Arne Johansen 
faj@bzz.no
http://bzz.no/?page=finnarne
Registered Linux user #86307 (http://counter.li.org)
--- autopartkit.c.org	Wed Oct 22 15:18:14 2003
+++ autopartkit.c	Wed Oct 22 15:24:54 2003
@@ -711,11 +711,17 @@
 static char *get_device_path(PedDevice *dev, PedPartition *freepart)
 { 
     char *retval;
-    char *tmp;
+    char *tmp, *next;
 
     asprintf(&retval, "%s%d", dev->path, freepart->num);
     /* Replace 'disc' with 'part'.  Sucks. */
-    if ((tmp = strstr(retval, "disc")))
+    next=retval;
+    while ((tmp = strstr(next + 1, "disc")))
+    {
+       next=tmp ;
+    }
+
+    if ((tmp = strstr(next, "disc")))
     {
         tmp[0] = 'p';
         tmp[1] = 'a';

Reply to: