summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-10-29 23:18:25 +0100
committerjcid <devnull@localhost>2007-10-29 23:18:25 +0100
commitffb17459b3ccb49ae0cfbe5ae2cd8d63a458d5d5 (patch)
tree0c3080b18b37b2fd6230c56a385f7500291d06cf
parent989a4d35b5f43bc72bfd930d409362fbc1a48a3f (diff)
Fixed a subtle bug in klist that was affecting IO.
-rw-r--r--ChangeLog1
-rw-r--r--src/IO/IO.c4
-rw-r--r--src/IO/http.c2
-rw-r--r--src/klist.c11
4 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 13185520..f90976dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,7 @@ dillo-fltk2
- Fixed the problem of scrolling position (remember position in a page).
- Implemented a new scheme of scroll-position remembering. This is one per
visited page intead of one per url (this is more standard).
+ - Fixed a subtle bug in klist that was affecting IO.
Patches: Jorge Arellano
+- Connected signals to <li> elements (fixes links within lists).
- Enabled text, background-color and geometry in preferences.
diff --git a/src/IO/IO.c b/src/IO/IO.c
index 8adb3658..d601478d 100644
--- a/src/IO/IO.c
+++ b/src/IO/IO.c
@@ -94,6 +94,8 @@ static void IO_ins(IOData_t *io)
if (io->Key == 0) {
io->Key = a_Klist_insert(&ValidIOs, io);
}
+ _MSG("IO_ins: io->Key=%d, Klist_length=%d\n",
+ io->Key, a_Klist_length(ValidIOs));
}
/*
@@ -298,7 +300,7 @@ static void IO_submit(IOData_t *r_io)
IO_ins(r_io);
_MSG("IO_submit:: (%s) FD = %d\n",
- (io->Op == IORead) ? "IORead" : "IOWrite", io->FD);
+ (r_io->Op == IORead) ? "IORead" : "IOWrite", r_io->FD);
/* Set FD to background and to close on exec. */
fcntl(r_io->FD, F_SETFL, O_NONBLOCK | fcntl(r_io->FD, F_GETFL));
diff --git a/src/IO/http.c b/src/IO/http.c
index f9b483fa..5c0250f1 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -320,7 +320,7 @@ static int Http_connect_socket(ChainLink *Info)
break;
}
#endif
- }
+ }/*switch*/
MSG_BW(S->web, 1, "Contacting host...");
status = connect(S->SockFD, (struct sockaddr *)&name, socket_len);
diff --git a/src/klist.c b/src/klist.c
index 113472b6..b353bb51 100644
--- a/src/klist.c
+++ b/src/klist.c
@@ -18,6 +18,7 @@
* remains with the caller.
*/
+#include "msg.h"
#include "klist.h"
@@ -30,6 +31,14 @@ static int Klist_node_by_key_cmp(const void *Node, const void *key)
}
/*
+ * Compare function for searching data by node
+ */
+static int Klist_node_by_node_cmp(const void *Node1, const void *Node2)
+{
+ return ((KlistNode_t *)Node1)->Key - ((KlistNode_t *)Node2)->Key;
+}
+
+/*
* Return the data pointer for a given Key (or NULL if not found)
*/
void *a_Klist_get_data(Klist_t *Klist, int Key)
@@ -68,7 +77,7 @@ int a_Klist_insert(Klist_t **Klist, void *Data)
Node = dNew(KlistNode_t, 1);
Node->Key = (*Klist)->Counter;
Node->Data = Data;
- dList_insert_sorted((*Klist)->List, Node, Klist_node_by_key_cmp);
+ dList_insert_sorted((*Klist)->List, Node, Klist_node_by_node_cmp);
return (*Klist)->Counter;
}