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

Re: gtk frontend for cdebconf, ready for commit



I did some hacking of cdebconf/src/test/test.config:

--- test.config 12 Dec 2000 05:13:36 -0000      1.7
+++ test.config 16 Sep 2002 09:27:38 -0000
@@ -1,5 +1,7 @@
 #!/bin/sh -e

+echo CAPB backup
+
 askquestion()
 {
        question=$1
@@ -7,8 +9,8 @@
        echo INPUT $priority $question
        read ans
        #echo $ans >&2
-       echo GO
-       read ans
+       #echo GO
+       #read ans
        #echo $ans >&2
 }

@@ -16,6 +18,9 @@
 #for t in boolean multiselect note password select string text; do
        askquestion "test/$t" low
 done
+
+echo GO
+read ans

 echo STOP
 exit 0

When I ran ../debconf test.config (using the gtk2 fe) and tried using
the Back button it segfaulted:

236       *pq = (*pq)->prev->prev;
(gdb) p (*pq)->prev
$2 = (struct question *) 0xe8
(gdb) p (*pq)->prev->prev
Cannot access memory at address 0x108

So it seems that the ->prev->prev pointer points to garbage. But why use
->prev->prev? If we want to go back, should we not use ->prev? Or is it
a hack so that in the next iteration, you can use q->next?

Bear in mind that for the first element of a double-linked list, the
invariant curr->prev->next == curr doesn't hold, since curr->prev
doesn't exist...

Also, I really dislike buttons that disappear and come back. If there's
going to be a Back button in the next dialog, please have a disabled
Back button in the first one too. Oh, another issue. Using Back and Next
isn't that good IMO. Previous and Next, or Back and Forward, but not
Back and Next...


When I get time to hack some more on it, I'll see if I can make the
"main loop" more intelligent when it comes to backing up.


Regards,
Martin

Attachment: signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad meddelandedel


Reply to: