r2532 jmb - /trunk/netsurf/content/urldb.c
by netsurf@semichrome.net
Author: jmb
Date: Sat Apr 15 18:48:47 2006
New Revision: 2532
URL: http://svn.semichrome.net?rev=2532&view=rev
Log:
Fix host match functions
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL: http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=2532&r1=2531&...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Sat Apr 15 18:48:47 2006
@@ -1984,7 +1984,8 @@
assert(a && b);
/* traverse up tree to root, comparing parts as we go. */
- for (; a && b; a = a->parent, b = b->parent)
+ for (; a && a != &db_root && b && b != &db_root;
+ a = a->parent, b = b->parent)
if ((ret = strcasecmp(a->part, b->part)) != 0)
/* They differ => return the difference here */
return ret;
@@ -1993,10 +1994,10 @@
* a) The path lengths differ
* or b) The hosts are identical
*/
- if (a && !b)
+ if (a && a != &db_root && (!b || b == &db_root))
/* len(a) > len(b) */
return 1;
- else if (!a && b)
+ else if ((!a || a == &db_root) && b && b != &db_root)
/* len(a) < len(b) */
return -1;
@@ -2017,7 +2018,7 @@
const char *end, *dot;
int plen, ret;
- assert(a && b);
+ assert(a && a != &db_root && b);
if (*b >= '0' && *b <= '9') {
/* IP address */
@@ -2026,7 +2027,7 @@
end = b + strlen(b);
- while (b < end && a) {
+ while (b < end && a && a != &db_root) {
dot = strchr(b, '.');
if (!dot) {
/* last segment */
@@ -2059,7 +2060,7 @@
if (a && a != &db_root && b >= end)
/* len(a) > len(b) */
return 1;
- else if (!a && b < end)
+ else if ((!a || a == &db_root) && b < end)
/* len(a) < len(b) */
return -1;
@@ -2080,7 +2081,7 @@
const char *end, *dot;
int plen, ret;
- assert(a && b);
+ assert(a && a != &db_root && b);
if (*b >= '0' && *b <= '9') {
/* IP address */
@@ -2089,7 +2090,7 @@
end = b + strlen(b);
- while (b < end && a) {
+ while (b < end && a && a != &db_root) {
dot = strchr(b, '.');
if (!dot) {
/* last segment */
@@ -2125,7 +2126,7 @@
if (a && a != &db_root && b >= end)
/* len(a) > len(b) => prefix matches */
return 0;
- else if (!a && b < end)
+ else if ((!a || a == &db_root) && b < end)
/* len(a) < len(b) => prefix does not match */
return -1;
16 years, 9 months
r2531 jmb - in /trunk/netsurf: desktop/options.c riscos/gui.c riscos/hotlist.c
by netsurf@semichrome.net
Author: jmb
Date: Sat Apr 15 16:23:23 2006
New Revision: 2531
URL: http://svn.semichrome.net?rev=2531&view=rev
Log:
Ensure hotlist URLs are retained in the database
Reduce number of unconditional calls to urldb_get_url_data
Modified:
trunk/netsurf/desktop/options.c
trunk/netsurf/riscos/gui.c
trunk/netsurf/riscos/hotlist.c
Modified: trunk/netsurf/desktop/options.c
URL: http://svn.semichrome.net/trunk/netsurf/desktop/options.c?rev=2531&r1=253...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Sat Apr 15 16:23:23 2006
@@ -432,15 +432,20 @@
}
data = urldb_get_url_data(url);
- if (!data)
+ if (!data) {
/* No entry in database, so add one */
urldb_add_url(url);
-
- data = urldb_get_url_data(url);
+ /* and bump visit data */
+ urldb_update_url_visit_data(url);
+ /* now attempt to get url data */
+ data = urldb_get_url_data(url);
+ }
if (!data)
return;
+
if (!data->title)
urldb_set_url_title(url, title);
+
entry = tree_create_URL_node(directory, url, data, title);
xmlFree(url);
xmlFree(title);
Modified: trunk/netsurf/riscos/gui.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/gui.c?rev=2531&r1=2530&r2=...
==============================================================================
--- trunk/netsurf/riscos/gui.c (original)
+++ trunk/netsurf/riscos/gui.c Sat Apr 15 16:23:23 2006
@@ -1526,9 +1526,11 @@
} else if ((hotlist_tree) && ((wimp_w)hotlist_tree->handle ==
message->data.data_xfer.w)) {
data = urldb_get_url_data(url);
- if (!data)
+ if (!data) {
urldb_add_url(url);
- data = urldb_get_url_data(url);
+ urldb_update_url_visit_data(url);
+ data = urldb_get_url_data(url);
+ }
if (data) {
ro_gui_tree_get_tree_coordinates(hotlist_tree,
message->data.data_xfer.pos.x,
Modified: trunk/netsurf/riscos/hotlist.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/hotlist.c?rev=2531&r1=2530...
==============================================================================
--- trunk/netsurf/riscos/hotlist.c (original)
+++ trunk/netsurf/riscos/hotlist.c Sat Apr 15 16:23:23 2006
@@ -103,10 +103,13 @@
for (i = 0; i != ENTRIES_COUNT; i++) {
data = urldb_get_url_data(default_entries[i].url);
- if (!data)
+ if (!data) {
urldb_add_url(default_entries[i].url);
-
- data = urldb_get_url_data(default_entries[i].url);
+ urldb_update_url_visit_data(
+ default_entries[i].url);
+ data = urldb_get_url_data(
+ default_entries[i].url);
+ }
if (data) {
tree_create_URL_node(node,
default_entries[i].url, data,
@@ -309,10 +312,11 @@
if (!node) {
if (url) {
data = urldb_get_url_data(url);
- if (!data)
+ if (!data) {
urldb_add_url(url);
-
- data = urldb_get_url_data(url);
+ urldb_update_url_visit_data(url);
+ data = urldb_get_url_data(url);
+ }
if (!data) {
free(url);
free(title);
16 years, 9 months
r2530 jmb - /trunk/netsurf/content/urldb.c
by netsurf@semichrome.net
Author: jmb
Date: Sat Apr 15 14:59:53 2006
New Revision: 2530
URL: http://svn.semichrome.net?rev=2530&view=rev
Log:
Fix undersized buffer for reading port number into
Detect no URLs for a host before adding host to database.
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL: http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=2530&r1=2529&...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Sat Apr 15 14:59:53 2006
@@ -312,13 +312,20 @@
}
}
+ /* read number of URLs */
+ if (!fgets(s, MAXIMUM_URL_LENGTH, fp))
+ break;
+ urls = atoi(s);
+
+ /* no URLs => try next host */
+ if (urls == 0) {
+ LOG(("No URLs for '%s'", host));
+ continue;
+ }
+
h = urldb_add_host(host);
if (!h)
die("Memory exhausted whilst loading URL file");
-
- if (!fgets(s, MAXIMUM_URL_LENGTH, fp))
- break;
- urls = atoi(s);
/* load the non-corrupt data */
for (i = 0; i < urls; i++) {
@@ -354,7 +361,7 @@
p = urldb_find_url(s);
}
} else {
- char scheme[64], ports[6];
+ char scheme[64], ports[10];
char url[64 + 3 + 256 + 6 + 4096 + 1];
unsigned int port;
bool is_file = false;
16 years, 9 months
r2529 jmb - /trunk/netsurf/riscos/global_history.c
by netsurf@semichrome.net
Author: jmb
Date: Fri Apr 14 01:27:49 2006
New Revision: 2529
URL: http://svn.semichrome.net?rev=2529&view=rev
Log:
Fix insertion of unordered base nodes
Modified:
trunk/netsurf/riscos/global_history.c
Modified: trunk/netsurf/riscos/global_history.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/global_history.c?rev=2529&...
==============================================================================
--- trunk/netsurf/riscos/global_history.c (original)
+++ trunk/netsurf/riscos/global_history.c Fri Apr 14 01:27:49 2006
@@ -285,26 +285,10 @@
visit_date = data->last_visit;
+ /* find parent node */
for (i = 0; i < global_history_base_node_count; i++) {
if (global_history_base_node_time[i] <= visit_date) {
parent = global_history_base_node[i];
- if (!parent->deleted)
- break;
- link = global_history_tree->root;
- for (j = 0; j < i; j++) {
- if (!global_history_base_node[j]->deleted) {
- link = global_history_base_node[j];
- before = true;
- break;
- }
- }
- tree_link_node(link, parent, before);
- if (!global_history_init) {
- tree_recalculate_node_positions(
- global_history_tree->root);
- tree_redraw_area(global_history_tree,
- 0, 0, 16384, 16384);
- }
break;
}
}
@@ -312,6 +296,30 @@
/* the entry is too old to care about */
if (!parent)
return true;
+
+ if (parent->deleted) {
+ /* parent was deleted, so find place to insert it */
+ link = global_history_tree->root;
+
+ for (j = global_history_base_node_count - 1; j >= 0; j--) {
+ if (!global_history_base_node[j]->deleted &&
+ global_history_base_node_time[j] >
+ global_history_base_node_time[i]) {
+ link = global_history_base_node[j];
+ before = true;
+ break;
+ }
+ }
+
+ tree_link_node(link, parent, before);
+
+ if (!global_history_init) {
+ tree_recalculate_node_positions(
+ global_history_tree->root);
+ tree_redraw_area(global_history_tree,
+ 0, 0, 16384, 16384);
+ }
+ }
/* find any previous occurance */
if (!global_history_init) {
16 years, 9 months
r2527 jmb - /trunk/netsurf/content/urldb.c
by netsurf@semichrome.net
Author: jmb
Date: Thu Apr 13 00:23:47 2006
New Revision: 2527
URL: http://svn.semichrome.net?rev=2527&view=rev
Log:
Fix issues with authentication storage/lookup in database
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL: http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=2527&r1=2526&...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Thu Apr 13 00:23:47 2006
@@ -838,7 +838,7 @@
*/
const char *urldb_get_auth_details(const char *url)
{
- struct path_data *p, *q;
+ struct path_data *p, *q = NULL;
assert(url);
@@ -849,6 +849,11 @@
if (!p)
return NULL;
+ /* Check for any auth details attached to this node */
+ if (p && p->auth.realm && p->auth.auth)
+ return p->auth.auth;
+
+ /* Now consider ancestors */
for (; p; p = p->parent) {
/* The parent path entry is stored hung off the
* parent entry with an empty (not NULL) segment string.
@@ -906,14 +911,27 @@
const char *auth)
{
struct path_data *p;
- char *t1, *t2;
+ char *urlt, *t1, *t2;
assert(url && realm && auth);
+ urlt = strdup(url);
+ if (!urlt)
+ return;
+
+ /* strip leafname from URL */
+ t1 = strrchr(urlt, '/');
+ if (t1) {
+ *(t1 + 1) = '\0';
+ }
+
/* add url, in case it's missing */
- urldb_add_url(url);
-
- p = urldb_find_url(url);
+ urldb_add_url(urlt);
+
+ p = urldb_find_url(urlt);
+
+ free(urlt);
+
if (!p)
return;
16 years, 9 months
r2526 tlsa - /trunk/netsurfweb/index.en
by netsurf@semichrome.net
Author: tlsa
Date: Wed Apr 12 19:32:12 2006
New Revision: 2526
URL: http://svn.semichrome.net?rev=2526&view=rev
Log:
Add last week's news.
Modified:
trunk/netsurfweb/index.en
Modified: trunk/netsurfweb/index.en
URL: http://svn.semichrome.net/trunk/netsurfweb/index.en?rev=2526&r1=2525&r2=2...
==============================================================================
--- trunk/netsurfweb/index.en (original)
+++ trunk/netsurfweb/index.en Wed Apr 12 19:32:12 2006
@@ -21,6 +21,18 @@
<p>Please try NetSurf out regularly and <a href="info#ContactDevelopers">send us feedback</a>. The <a href="progress">progress</a> page provides an overview of NetSurf's current status.</p>
<h2>News</h2>
+<div class="newsitem">
+<p>09 Apr 2006 - <em>Summary of recent changes</em></p>
+<p>Choices interface, Scale view, Bug fixes</p>
+<p class="more"><a href="http://sourceforge.net/mailarchive/message.php?msg_id=15354194">Read more...</a></p>
+</div>
+
+<div class="newsitem">
+<p>09 Apr 2006 - <em>Moved to Subversion</em></p>
+<p>We have moved to Subversion, a more powerful and advanced versioning system than CVS.</p>
+<p class="more"><a href="http://sourceforge.net/mailarchive/message.php?msg_id=15352736">Read more...</a></p>
+</div>
+
<div class="newsitem">
<p>02 Apr 2006 - <em>Summary of recent changes</em></p>
<p>Radio and checkbox icons, Plain text, Local history</p>
16 years, 9 months
r2524 jmb - in /trunk/netsurf: content/fetch.c content/fetchcache.c content/urldb.c debug/netsurfd.c riscos/gui.c riscos/menus.c
by netsurf@semichrome.net
Author: jmb
Date: Wed Apr 12 09:09:27 2006
New Revision: 2524
URL: http://svn.semichrome.net?rev=2524&view=rev
Log:
Fix URL file loading and add support for file:/// URLs to urldb
Convert file:/... to file:///... (the former isn't a valid URL)
Modified:
trunk/netsurf/content/fetch.c
trunk/netsurf/content/fetchcache.c
trunk/netsurf/content/urldb.c
trunk/netsurf/debug/netsurfd.c
trunk/netsurf/riscos/gui.c
trunk/netsurf/riscos/menus.c
Modified: trunk/netsurf/content/fetch.c
URL: http://svn.semichrome.net/trunk/netsurf/content/fetch.c?rev=2524&r1=2523&...
==============================================================================
--- trunk/netsurf/content/fetch.c (original)
+++ trunk/netsurf/content/fetch.c Wed Apr 12 09:09:27 2006
@@ -1242,9 +1242,6 @@
if (strncmp(f->url, "file:///", 8) == 0)
url_path = curl_unescape(f->url + 7,
(int) strlen(f->url) - 7);
- else if (strncmp(f->url, "file:/", 6) == 0)
- url_path = curl_unescape(f->url + 5,
- (int) strlen(f->url) - 5);
if (url_path && stat(url_path, &s) == 0) {
/* file: URL and file exists */
Modified: trunk/netsurf/content/fetchcache.c
URL: http://svn.semichrome.net/trunk/netsurf/content/fetchcache.c?rev=2524&r1=...
==============================================================================
--- trunk/netsurf/content/fetchcache.c (original)
+++ trunk/netsurf/content/fetchcache.c Wed Apr 12 09:09:27 2006
@@ -82,8 +82,35 @@
char *etag = 0;
time_t date = 0;
- if ((url1 = strdup(url)) == NULL)
- return NULL;
+ if (strncasecmp(url, "file:///", 8) &&
+ strncasecmp(url, "file:/", 6) == 0) {
+ /* Manipulate file URLs into correct format */
+ if (strncasecmp(url, "file://", 7) == 0) {
+ /* file://host/... */
+ char *slash = 0;
+
+ url1 = malloc(7 + strlen(url));
+ if (!url1)
+ return NULL;
+
+ strcpy(url1, "file://");
+ slash = strchr(url + 7, '/');
+ if (slash)
+ strcat(url1 + 7, slash);
+ } else {
+ /* file:/... */
+ url1 = malloc(7 + strlen(url));
+ if (!url1)
+ return NULL;
+
+ strcpy(url1, "file://");
+ strcat(url1 + 7, url + 5);
+ }
+ } else {
+ /* simply duplicate the URL */
+ if ((url1 = strdup(url)) == NULL)
+ return NULL;
+ }
/* strip fragment identifier */
if ((hash = strchr(url1, '#')) != NULL)
Modified: trunk/netsurf/content/urldb.c
URL: http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=2524&r1=2523&...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Wed Apr 12 09:09:27 2006
@@ -300,6 +300,18 @@
continue;
}
+ if (version == 105) {
+ /* file:/ -> localhost */
+ if (strcasecmp(host, "file:/") == 0)
+ snprintf(host, sizeof host, "localhost");
+ else {
+ /* strip any port number */
+ char *colon = strrchr(host, ':');
+ if (colon)
+ *colon = '\0';
+ }
+ }
+
h = urldb_add_host(host);
if (!h)
die("Memory exhausted whilst loading URL file");
@@ -318,14 +330,34 @@
length = strlen(s) - 1;
s[length] = '\0';
- if (!urldb_add_url(s)) {
- LOG(("Failed inserting '%s'", s));
+ if (strncasecmp(s, "file:", 5) == 0) {
+ /* local file, so fudge insertion */
+ char url[7 + 4096];
+
+ snprintf(url, sizeof url,
+ "file://%s", s + 5);
+
+ p = urldb_add_path("file", 0, h,
+ s + 5, NULL, url);
+ if (!p) {
+ LOG(("Failed inserting '%s'",
+ url));
+ die("Memory exhausted "
+ "whilst loading "
+ "URL file");
+ }
+ } else {
+ if (!urldb_add_url(s)) {
+ LOG(("Failed inserting '%s'",
+ s));
+ }
+ p = urldb_find_url(s);
}
- p = urldb_find_url(s);
} else {
char scheme[64], ports[6];
char url[64 + 3 + 256 + 6 + 4096 + 1];
unsigned int port;
+ bool is_file = false;
if (!fgets(scheme, sizeof scheme, fp))
break;
@@ -343,7 +375,14 @@
length = strlen(s) - 1;
s[length] = '\0';
- sprintf(url, "%s://%s%s%s%s", scheme, host,
+ if (!strcasecmp(host, "localhost") &&
+ !strcasecmp(scheme, "file"))
+ is_file = true;
+
+ snprintf(url, sizeof url, "%s://%s%s%s%s",
+ scheme,
+ /* file URLs have no host */
+ (is_file ? "" : host),
(port ? ":" : ""),
(port ? ports : ""),
s);
@@ -598,7 +637,7 @@
/**
* Insert an URL into the database
*
- * \param url URL to insert
+ * \param url Absolute URL to insert
* \return true on success, false otherwise
*/
bool urldb_add_url(const char *url)
@@ -610,8 +649,6 @@
url_func_result ret;
assert(url);
-
- /** \todo consider file: URLs */
urlt = strdup(url);
if (!urlt)
@@ -663,7 +700,10 @@
}
/* Get host entry */
- h = urldb_add_host(host);
+ if (strcasecmp(scheme, "file") == 0)
+ h = urldb_add_host("localhost");
+ else
+ h = urldb_add_host(host);
if (!h) {
free(scheme);
free(plq);
@@ -1203,6 +1243,10 @@
if (!parent->children) {
/* leaf node */
+ /* All leaf nodes in the path tree should have an URL
+ * attached to them. If this is not the case, it indicates
+ * that there's a bug in the file loader/URL insertion code.
+ * Therefore, assert this here. */
assert(parent->url);
/** \todo handle fragments? */
@@ -1553,7 +1597,7 @@
/**
* Find an URL in the database
*
- * \param url The URL to find
+ * \param url Absolute URL to find
* \return Pointer to path data, or NULL if not found
*/
struct path_data *urldb_find_url(const char *url)
@@ -1562,12 +1606,11 @@
struct path_data *p;
struct search_node *tree;
char *host, *plq, *scheme, *colon;
+ const char *domain;
unsigned short port;
url_func_result ret;
assert(url);
-
- /** \todo consider file: URLs */
/* extract host */
ret = url_host(url, &host);
@@ -1597,10 +1640,16 @@
port = atoi(colon + 1);
}
- if (*host >= '0' && *host <= '9')
+ /* file urls have no host, so manufacture one */
+ if (strcasecmp(scheme, "file") == 0)
+ domain = "localhost";
+ else
+ domain = host;
+
+ if (*domain >= '0' && *domain <= '9')
tree = search_trees[ST_IP];
- else if (isalpha(*host))
- tree = search_trees[ST_DN + tolower(*host) - 'a'];
+ else if (isalpha(*domain))
+ tree = search_trees[ST_DN + tolower(*domain) - 'a'];
else {
free(plq);
free(host);
@@ -1608,7 +1657,7 @@
return NULL;
}
- h = urldb_search_find(tree, host);
+ h = urldb_search_find(tree, domain);
if (!h) {
free(plq);
free(host);
Modified: trunk/netsurf/debug/netsurfd.c
URL: http://svn.semichrome.net/trunk/netsurf/debug/netsurfd.c?rev=2524&r1=2523...
==============================================================================
--- trunk/netsurf/debug/netsurfd.c (original)
+++ trunk/netsurf/debug/netsurfd.c Wed Apr 12 09:09:27 2006
@@ -43,8 +43,8 @@
#ifdef riscos
void *ro_gui_current_redraw_gui = 0;
const char *NETSURF_DIR = "<NetSurf$Dir>";
-char *default_stylesheet_url = "file:/<NetSurf$Dir>/Resources/CSS";
-char *adblock_stylesheet_url = "file:/<NetSurf$Dir>/Resources/AdBlock";
+char *default_stylesheet_url = "file:///<NetSurf$Dir>/Resources/CSS";
+char *adblock_stylesheet_url = "file:///<NetSurf$Dir>/Resources/AdBlock";
#endif
static void callback(content_msg msg, struct content *c, void *p1,
Modified: trunk/netsurf/riscos/gui.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/gui.c?rev=2524&r1=2523&r2=...
==============================================================================
--- trunk/netsurf/riscos/gui.c (original)
+++ trunk/netsurf/riscos/gui.c Wed Apr 12 09:09:27 2006
@@ -382,8 +382,8 @@
messages_load(path);
messages_load("NetSurf:Resources.LangNames");
- default_stylesheet_url = strdup("file:/NetSurf:/Resources/CSS");
- adblock_stylesheet_url = strdup("file:/NetSurf:/Resources/AdBlock");
+ default_stylesheet_url = strdup("file:///NetSurf:/Resources/CSS");
+ adblock_stylesheet_url = strdup("file:///NetSurf:/Resources/AdBlock");
if (!default_stylesheet_url || !adblock_stylesheet_url)
die("Failed initialising string constants.");
@@ -695,7 +695,7 @@
LOG(("malloc failed"));
die("Insufficient memory for URL");
}
- snprintf(url, 80, "file:/<NetSurf$Dir>/Docs/intro_%s",
+ snprintf(url, 80, "file:///<NetSurf$Dir>/Docs/intro_%s",
option_language);
}
@@ -1199,7 +1199,7 @@
browser_window_create(option_homepage_url, NULL, 0);
} else {
snprintf(url, sizeof url,
- "file:/<NetSurf$Dir>/Docs/intro_%s",
+ "file:///<NetSurf$Dir>/Docs/intro_%s",
option_language);
browser_window_create(url, NULL, 0);
}
@@ -1877,7 +1877,7 @@
url = malloc(80);
if (url)
snprintf(url, 80,
- "file:/<NetSurf$Dir>/Docs/intro_%s",
+ "file:///<NetSurf$Dir>/Docs/intro_%s",
option_language);
}
if (!url)
@@ -2028,9 +2028,9 @@
return 0;
}
- strcpy(url, "file:");
- __unixify(buffer, __RISCOSIFY_NO_REVERSE_SUFFIX, url + 5,
- 1 - spare + 5, 0);
+ strcpy(url, "file://");
+ __unixify(buffer, __RISCOSIFY_NO_REVERSE_SUFFIX, url + 7,
+ 1 - spare + 3 /* 10 - "file://" */, 0);
free(buffer);
return url;
}
@@ -2048,13 +2048,10 @@
char *temp_name, *r;
char *filename;
- if (strncmp(url, "file:/", 5))
+ if (strncmp(url, "file:///", 8))
return NULL;
- if (!strncmp(url, "file:///", 8))
- temp_name = curl_unescape(url + 7, strlen(url) - 7);
- else
- temp_name = curl_unescape(url + 5, strlen(url) - 5);
+ temp_name = curl_unescape(url + 7, strlen(url) - 7);
if (!temp_name) {
warn_user("NoMemory", 0);
@@ -2063,7 +2060,7 @@
filename = malloc(strlen(temp_name) + 100);
if (!filename) {
- curl_free(temp_name);
+ curl_free(temp_name);
warn_user("NoMemory", 0);
return NULL;
}
@@ -2128,7 +2125,7 @@
int length;
if ((length = snprintf(url, sizeof url,
- "file:/<NetSurf$Dir>/Docs/%s_%s",
+ "file:///<NetSurf$Dir>/Docs/%s_%s",
page, option_language)) >= 0 && length < (int)sizeof(url))
browser_window_create(url, NULL, 0);
}
Modified: trunk/netsurf/riscos/menus.c
URL: http://svn.semichrome.net/trunk/netsurf/riscos/menus.c?rev=2524&r1=2523&r...
==============================================================================
--- trunk/netsurf/riscos/menus.c (original)
+++ trunk/netsurf/riscos/menus.c Wed Apr 12 09:09:27 2006
@@ -1387,7 +1387,7 @@
return true;
case HELP_OPEN_ABOUT:
browser_window_create(
- "file:/<NetSurf$Dir>/Docs/about",
+ "file:///<NetSurf$Dir>/Docs/about",
0, 0);
return true;
case HELP_LAUNCH_INTERACTIVE:
@@ -1503,7 +1503,7 @@
option_homepage_url, 0);
} else {
snprintf(url, sizeof url,
- "file:/<NetSurf$Dir>/Docs/intro_%s",
+ "file:///<NetSurf$Dir>/Docs/intro_%s",
option_language);
browser_window_go(g->bw, url, 0);
}
16 years, 9 months