Probable fix for bug #3095552
by Martin Bazley
http://sourceforge.net/tracker/index.php?func=detail&aid=3095552&group_id...
Brief synopsis: escape char handling in the new treeview hotlist URL
code is broken, in that it considers colons and slashes, among other
things, to be invalid characters. Thus, editing an entry for
riscos.info in the hotlist causes it to change from:
http://www.riscos.info/index.php/RISC_OS
to:
http://http%3a%2f%2fwww.riscos.info%2findex.php%2frisc_os/
The code responsible is in desktop/tree_url_node.c, function
tree_url_node_callback(), from line 398 (case
NODE_ELEMENT_EDIT_FINISHING:).
In my initial post, I believed the fault was merely that of
over-enthusiastic escaping of characters, but I've now had a more
detailed think about the problem and I've realised that it was erroneous
to call url_escape() in the first place, as its function is to remove
characters which carry special meaning - in other words, any characters
which tell you anything about the URL at all.
In the case of the hotlist, the only items in there under normal
circumstances will be those that have been added from a browser window -
i.e. those that are, by definition, valid. Therefore, the only possible
consequence of escaping a URL which is intended to be launched later is
to break it.
Another fault with the current system is that it doesn't even manage to
pick up URLs that *are* invalid. A blank string, for example, will
simply translate to "http:///".
In light of this, my revised and totally untested (I don't even know if
it compiles) diff is (sorry about the indentation, I did change it but
diff doesn't think so):
--- RAM::RamDisc0.$.tree_url_node/c 2010-10-27 20:08:25.0 +0100
+++ RAM::RamDisc0.$.tree_url_node2/c 2010-10-27 20:08:25.0 +0100
@@ -360,7 +360,7 @@
struct node_element *element;
url_func_result res;
const char *text;
- char *norm_text, *escaped_text;
+ char *norm_text;
const struct url_data *data;
/** @todo memory leaks on non-shared folder deletion. */
@@ -400,10 +400,7 @@
text = msg_data->data.text;
if (msg_data->flag == TREE_ELEMENT_URL) {
- res = url_escape(text, 0, false, NULL,
- &escaped_text);
- if (res == URL_FUNC_OK)
- res = url_normalize(escaped_text,
+ res = url_normalize(text,
&norm_text);
if (res != URL_FUNC_OK) {
if (res == URL_FUNC_FAILED) {
--
__<^>__
/ _ _ \ I don't have a problem with God; it's his fan club I can't stand.
( ( |_| ) )
\_> <_/ ======================= Martin Bazley ==========================
12 years, 11 months
hubbub from C++ code
by emathemat@gmail.com
At this moment if you want to link hubbub(and parserutils) library
from C++ code it is necessary to wrap include directives with such
construction
extern "C" {
#include <hubbub/hubbub.h>
}
This is not hard, but looks ugly.
It is almost a standard in C's world to add this to interface headers
#ifdef __cplusplus
extern "C" {
#endif
/*header body*/
#ifdef __cplusplus
}
#endif
I wrote simple utility placed in
http://code.google.com/p/hotdox/source/browse/trunk/cpp_header_for_c/cpp_...
. It insert such headers. It is not a ideal, but works great for
hubbub's and parserutils's interface headers. If devs has no time for
such transformation, I can do it by myself and ci to svn( if you give
permission to me) or send a patch files.
12 years, 11 months
initial gui_window_position_frame
by m0n0
Hello,
when initial gui_window_position_frame is called the
first time, x1/y1 is -1. I guess this is because I
haven't called browser_window_reformat after openening
the frame ( browser_window_reformat is the correct
function for letting netsurf know the size of an
window? Is there any better function to call after
resize? ).
I can't call browser_window_reformat right after
creation of an frame or window, because that throws an
assert about an invalid state for
browser_window_reformat...
How Do I tell NetSurf the size of the window/frame
after creating an frame? Or should I handle the -1
differently?
If I resize the window, I call
browser_window_reformat, which also results in
gui_window_position_frame, but this time x1,y1 is set
correct like I reported it to browser_window_reformat.
Maybe there is an callback which is called after the
page rendering is complete? So that I could call
browser_window_reformat then?
Thanks for reading & Greets,
Ole
12 years, 11 months
Segfault within framebuffer version / Patch for cookies.c
by m0n0
Hello,
because the last message isn't decoded from base64 into plain text, I send
it again... :
Hello,
some of the changes lately happened to desktop/cookies.c result in
Segmentation fault within the framebuffer (trunk) version. The bug is also
added to the bug-tracker.
Here is an patch for cookies.c which prevents this Seg Fault:
--- desktop/cookies.c.orig 2010-10-06 19:30:46.000000000 +0200
+++ desktop/cookies.c 2010-10-06 19:40:32.000000000 +0200
@@ -407,8 +407,8 @@
{
assert(data != NULL);
assert(user_delete == false);
-
- schedule(100, cookies_schedule_callback, (void *)data);
+ if( cookies_tree_root != NULL )
+ schedule(100, cookies_schedule_callback, (void *)data);
return true;
}
@@ -419,7 +419,8 @@
{
assert(data != NULL);
- schedule_remove(cookies_schedule_callback, (void *)data);
+ if( cookies_tree_root != NULL )
+ schedule_remove(cookies_schedule_callback, (void *)data);
}
12 years, 12 months
Segfault within framebuffer version / Patch for cookies.c
by m0n0
Hello,
some of the changes lately happened to desktop/cookies.c result in
Segmentation fault within the framebuffer (trunk) version.
Here is an patch for cookies.c which prevents this Seg Fault:
--- desktop/cookies.c.orig 2010-10-06 19:30:46.000000000 +0200
+++ desktop/cookies.c 2010-10-06 19:40:32.000000000 +0200
@@ -407,8 +407,8 @@
{
assert(data != NULL);
assert(user_delete == false);
-
- schedule(100, cookies_schedule_callback, (void *)data);
+ if( cookies_tree_root != NULL )
+ schedule(100, cookies_schedule_callback, (void *)data);
return true;
}
@@ -419,7 +419,8 @@
{
assert(data != NULL);
- schedule_remove(cookies_schedule_callback, (void *)data);
+ if( cookies_tree_root != NULL )
+ schedule_remove(cookies_schedule_callback, (void *)data);
}
---
Greets,
m
12 years, 12 months
Framebuffer OSK
by m0n0
Hello,
in my opinion the framebuffer OSK should have an ':' key. Without that
key, you are not able to input an complete URL like https: or http:
with it.
Greets,
m
12 years, 12 months
RFC: WebP support in NetSurf (patch)
by Chris Young
Hi all
As I'm sure you're aware, Google announced a new image format a couple
of days ago, intended to replace JPEG for images on the web. I've
been playing around with it, and although we don't know yet whether it
will take off, I thought it would be fun to make NetSurf one of the
first (if not _the_ first) web browser to support the new format.
The attached patch adds this support, using Google's "libwebp" (which
is actually the source code file webpimg.c I've dropped in - with
minor tweaks - it doesn't build itself as a real library).
Caveats:
1. The conversion is an endian-aware conversion to RGBA. This is
fine for big-endian platforms, but on little-endian the byte order
will be wrong for NetSurf.
2. It requires libvpx. Much porting fun.
For those reasons I've enabled support for WebP only on the Amiga
platform build - that's all I'm in a position to test at the moment.
I suggest testing and enabling/adding the makefile/makefile.defaults
lines on a platform-by-platform basis.
If everybody is happy I'll commit it.
Chris
12 years, 12 months