r12127 jmb - /trunk/netsurf/riscos/download.c
by netsurf@semichrome.net
Author: jmb
Date: Wed Mar 23 15:59:43 2011
New Revision: 12127
URL: http://source.netsurf-browser.org?rev=12127&view=rev
Log:
Fix bug #3238151: reinstate filename sanitisation and extension stripping
Modified:
trunk/netsurf/riscos/download.c
Modified: trunk/netsurf/riscos/download.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/download.c?rev=121...
==============================================================================
--- trunk/netsurf/riscos/download.c (original)
+++ trunk/netsurf/riscos/download.c Wed Mar 23 15:59:43 2011
@@ -228,7 +228,7 @@
url_func_result res;
char *local_path;
utf8_convert_ret err;
- size_t i;
+ size_t i, last_dot;
dw = malloc(sizeof *dw);
if (!dw) {
@@ -354,9 +354,18 @@
return 0;
}
- for (i = 0; filename[i] != '\0'; i++)
- if (filename[i] == '.')
+ for (i = 0, last_dot = (size_t) -1; filename[i] != '\0'; i++) {
+ const char c = filename[i];
+
+ if (c == '.') {
+ last_dot = i;
filename[i] = '/';
+ } else if (c <= ' ' || strchr(":*#$&@^%\\", c) != NULL)
+ filename[i] = '_';
+ }
+
+ if (option_strip_extensions && last_dot != (size_t) -1)
+ filename[last_dot] = '\0';
if (download_dir != NULL && strlen(download_dir) > 0)
snprintf(dw->path, RO_DOWNLOAD_MAX_PATH_LEN, "%s.%s",
12 years, 2 months
r12126 jmb - /trunk/netsurf/render/html.c
by netsurf@semichrome.net
Author: jmb
Date: Wed Mar 23 15:39:18 2011
New Revision: 12126
URL: http://source.netsurf-browser.org?rev=12126&view=rev
Log:
Fix bug #3238323: pass correct context pointer for html_object_callback
Modified:
trunk/netsurf/render/html.c
Modified: trunk/netsurf/render/html.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.c?rev=12126&r...
==============================================================================
--- trunk/netsurf/render/html.c (original)
+++ trunk/netsurf/render/html.c Wed Mar 23 15:39:18 2011
@@ -1343,7 +1343,7 @@
/* initialise fetch */
error = hlcache_handle_retrieve(url2, 0, content__get_url(c), NULL,
- html_object_callback, c, &child,
+ html_object_callback, object, &child,
object->permitted_types,
&object->content);
12 years, 2 months
r12125 vince - in /trunk/netsurf/windows: gui.c res/NetSurf.ico res/NetSurf16.ico res/NetSurf32.ico res/resource.rc resourceid.h
by netsurf@semichrome.net
Author: vince
Date: Tue Mar 22 17:37:02 2011
New Revision: 12125
URL: http://source.netsurf-browser.org?rev=12125&view=rev
Log:
Improve icon resource to contain all standard sizes and depths
Added:
trunk/netsurf/windows/res/NetSurf.ico (with props)
Removed:
trunk/netsurf/windows/res/NetSurf16.ico
trunk/netsurf/windows/res/NetSurf32.ico
Modified:
trunk/netsurf/windows/gui.c
trunk/netsurf/windows/res/resource.rc
trunk/netsurf/windows/resourceid.h
Modified: trunk/netsurf/windows/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/gui.c?rev=12125&r...
==============================================================================
--- trunk/netsurf/windows/gui.c (original)
+++ trunk/netsurf/windows/gui.c Tue Mar 22 17:37:02 2011
@@ -1638,12 +1638,12 @@
w.cbClsExtra = 0;
w.cbWndExtra = 0;
w.hInstance = hinstance;
- w.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF32_ICON)); /* -> NetSurf */
+ w.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF_ICON));
w.hCursor = NULL;
w.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
w.lpszMenuName = NULL;
w.lpszClassName = windowclassname_main;
- w.hIconSm = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF16_ICON)); /* -> NetSurf */
+ w.hIconSm = LoadIcon(hinstance, MAKEINTRESOURCE(IDR_NETSURF_ICON));
RegisterClassEx(&w);
/* drawable area */
Added: trunk/netsurf/windows/res/NetSurf.ico
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/NetSurf.ico?r...
==============================================================================
Binary file - no diff available.
Propchange: trunk/netsurf/windows/res/NetSurf.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Removed: trunk/netsurf/windows/res/NetSurf16.ico
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/NetSurf16.ico...
==============================================================================
Binary file - no diff available.
Removed: trunk/netsurf/windows/res/NetSurf32.ico
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/NetSurf32.ico...
==============================================================================
Binary file - no diff available.
Modified: trunk/netsurf/windows/res/resource.rc
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/res/resource.rc?r...
==============================================================================
--- trunk/netsurf/windows/res/resource.rc (original)
+++ trunk/netsurf/windows/res/resource.rc Tue Mar 22 17:37:02 2011
@@ -5,8 +5,7 @@
#include "../resourceid.h"
-IDR_NETSURF32_ICON ICON DISCARDABLE "NetSurf32.ico"
-IDR_NETSURF16_ICON ICON DISCARDABLE "NetSurf16.ico"
+IDR_NETSURF_ICON ICON DISCARDABLE "NetSurf.ico"
IDR_TOOLBAR_BITMAP BITMAP DISCARDABLE "toolbar.bmp"
IDR_TOOLBAR_BITMAP_GREY BITMAP DISCARDABLE "toolbarg.bmp"
IDR_TOOLBAR_BITMAP_HOT BITMAP DISCARDABLE "toolbarh.bmp"
@@ -118,15 +117,15 @@
END
END
-IDD_DLG_ABOUT DIALOGEX 10,10,309,180
+IDD_DLG_ABOUT DIALOGEX 10,10,206,180
CAPTION "About NetSurf"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU
EXSTYLE WS_EX_DLGMODALFRAME
BEGIN
- CONTROL IDR_NETSURF_BANNER,IDC_IMG1,"Static",SS_BITMAP,0,0,308,86
- CONTROL "",IDC_ABOUT_CONTENT,"Static",WS_CHILDWINDOW|WS_VISIBLE,10,93,288,63
- CONTROL "&OK",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,246,160,54,15
+ CONTROL IDR_NETSURF_BANNER,IDC_IMG1,"Static",SS_BITMAP|0x40L /*SS_REALSIZECONTROL*/,0,0,205,53
+ CONTROL "",IDC_ABOUT_CONTENT,"Static",WS_CHILDWINDOW|WS_VISIBLE,10,60,185,63
+ CONTROL "&OK",IDOK,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,143,160,54,15
CONTROL "&Credits",IDC_BTN_CREDITS,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,10,160,54,15
CONTROL "&Licence",IDC_BTN_LICENCE,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,70,160,54,15
END
Modified: trunk/netsurf/windows/resourceid.h
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/resourceid.h?rev=...
==============================================================================
--- trunk/netsurf/windows/resourceid.h (original)
+++ trunk/netsurf/windows/resourceid.h Tue Mar 22 17:37:02 2011
@@ -23,8 +23,7 @@
#define IDC_STATIC (-1)
#endif
-#define IDR_NETSURF32_ICON 100
-#define IDR_NETSURF16_ICON 101
+#define IDR_NETSURF_ICON 100
#define IDR_TOOLBAR_BITMAP 102
#define IDR_TOOLBAR_BITMAP_GREY 103
#define IDR_TOOLBAR_BITMAP_HOT 104
12 years, 2 months
r12124 dsilvers - /trunk/netsurf/
by netsurf@semichrome.net
Author: dsilvers
Date: Tue Mar 22 07:43:54 2011
New Revision: 12124
URL: http://source.netsurf-browser.org?rev=12124&view=rev
Log:
Add NetSurf.app to ignore list so it doesn't peturb the testament
Modified:
trunk/netsurf/ (props changed)
Propchange: trunk/netsurf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 22 07:43:54 2011
@@ -2,6 +2,7 @@
nsgtk
nsfb
NetSurf.exe
+NetSurf.app
NetSurf.dbg
NetSurf
core
12 years, 2 months
r12123 dsilvers - /trunk/netsurf/cocoa/Makefile.target
by netsurf@semichrome.net
Author: dsilvers
Date: Tue Mar 22 07:42:30 2011
New Revision: 12123
URL: http://source.netsurf-browser.org?rev=12123&view=rev
Log:
Fix testament rule for cocoa's build system's prefixed paths
Modified:
trunk/netsurf/cocoa/Makefile.target
Modified: trunk/netsurf/cocoa/Makefile.target
URL: http://source.netsurf-browser.org/trunk/netsurf/cocoa/Makefile.target?rev...
==============================================================================
--- trunk/netsurf/cocoa/Makefile.target (original)
+++ trunk/netsurf/cocoa/Makefile.target Tue Mar 22 07:42:30 2011
@@ -117,6 +117,10 @@
SOURCES := $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_COCOA) $(S_TABBAR)
SOURCES := $(addprefix $(shell pwd)/,$(SOURCES))
+# Since we prefix the sources with the pwd, also create a special
+# prefixed rule so that the testament is run
+$(shell pwd)/content/fetchers/about.c: testament
+
EXETARGET := NetSurf
S_XIBS := MainMenu.xib Browser.xib BrowserWindow.xib DownloadWindow.xib SearchWindow.xib PreferencesWindow.xib \
12 years, 2 months
r12122 dsilvers - in /trunk/netsurf: Makefile Makefile.sources
by netsurf@semichrome.net
Author: dsilvers
Date: Tue Mar 22 07:04:02 2011
New Revision: 12122
URL: http://source.netsurf-browser.org?rev=12122&view=rev
Log:
Try encouraging the auto-build of testament a little harder
Modified:
trunk/netsurf/Makefile
trunk/netsurf/Makefile.sources
Modified: trunk/netsurf/Makefile
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile?rev=12122&r1=121...
==============================================================================
--- trunk/netsurf/Makefile (original)
+++ trunk/netsurf/Makefile Tue Mar 22 07:04:02 2011
@@ -470,7 +470,7 @@
all-program: $(EXETARGET) post-exe
.PHONY: testament
-testament:
+testament utils/testament.h:
$(Q)$(PERL) utils/svn-testament.pl $(CURDIR) utils/testament.h
post-exe: $(POSTEXES)
Modified: trunk/netsurf/Makefile.sources
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.sources?rev=1212...
==============================================================================
--- trunk/netsurf/Makefile.sources (original)
+++ trunk/netsurf/Makefile.sources Tue Mar 22 07:04:02 2011
@@ -46,7 +46,7 @@
S_BROWSER := $(addprefix desktop/,$(S_BROWSER))
# The following files depend on the testament
-content/fetchers/about.c: testament
+content/fetchers/about.c: testament utils/testament.h
# Some extra rules for building the transliteration table.
ifeq ($(HOST),riscos)
12 years, 2 months
r12121 mmu_man - /trunk/libsvgtiny/src/Makefile
by netsurf@semichrome.net
Author: mmu_man
Date: Mon Mar 21 17:07:10 2011
New Revision: 12121
URL: http://source.netsurf-browser.org?rev=12121&view=rev
Log:
sed in BeOS still doesn't handle -i, so use a temporary file since RiscOS doesn't know pipes.
Modified:
trunk/libsvgtiny/src/Makefile
Modified: trunk/libsvgtiny/src/Makefile
URL: http://source.netsurf-browser.org/trunk/libsvgtiny/src/Makefile?rev=12121...
==============================================================================
--- trunk/libsvgtiny/src/Makefile (original)
+++ trunk/libsvgtiny/src/Makefile Mon Mar 21 17:07:10 2011
@@ -5,8 +5,9 @@
$(BUILDDIR)/src_colors.c: src/colors.gperf
$(VQ)$(ECHO) " GPERF: $<"
- $(Q)gperf --output-file=$@ $<
+ $(Q)gperf --output-file=$@.tmp $<
# Hack for GCC 4.2 compatibility (gperf 3.0.4 solves this properly)
- $(Q)$(SED) -i -e 's/#ifdef __GNUC_STDC_INLINE__/#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__/' $@
+ $(Q)$(SED) -e 's/#ifdef __GNUC_STDC_INLINE__/#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__/' $@.tmp >$@
+ $(Q)$(RM) $@.tmp
include build/makefiles/Makefile.subdir
12 years, 2 months
r12120 mmu_man - /trunk/netsurf/
by netsurf@semichrome.net
Author: mmu_man
Date: Mon Mar 21 16:33:46 2011
New Revision: 12120
URL: http://source.netsurf-browser.org?rev=12120&view=rev
Log:
Add the BeOS NetSurf binary and the debugger data to ignored files.
Modified:
trunk/netsurf/ (props changed)
Propchange: trunk/netsurf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 21 16:33:46 2011
@@ -2,6 +2,8 @@
nsgtk
nsfb
NetSurf.exe
+NetSurf.dbg
+NetSurf
core
nsfb-*
build-*
12 years, 2 months
r12119 mmu_man - in /trunk/netsurf/beos: beos_fetch_rsrc.cpp beos_filetype.cpp beos_gui.cpp beos_res.rdef res/beosdefault.css res/en res/internal.css res/netsurf.png
by netsurf@semichrome.net
Author: mmu_man
Date: Mon Mar 21 16:15:58 2011
New Revision: 12119
URL: http://source.netsurf-browser.org?rev=12119&view=rev
Log:
Change rsrc: fetcher to check the mime type of resources from the extension. Add needed resource to get about: working.
Added:
trunk/netsurf/beos/res/en (with props)
trunk/netsurf/beos/res/internal.css (with props)
trunk/netsurf/beos/res/netsurf.png (with props)
Modified:
trunk/netsurf/beos/beos_fetch_rsrc.cpp
trunk/netsurf/beos/beos_filetype.cpp
trunk/netsurf/beos/beos_gui.cpp
trunk/netsurf/beos/beos_res.rdef
trunk/netsurf/beos/res/beosdefault.css
Modified: trunk/netsurf/beos/beos_fetch_rsrc.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_fetch_rsrc.cpp?...
==============================================================================
--- trunk/netsurf/beos/beos_fetch_rsrc.cpp (original)
+++ trunk/netsurf/beos/beos_fetch_rsrc.cpp Mon Mar 21 16:15:58 2011
@@ -171,17 +171,10 @@
"Malformed rsrc: URL", 0, FETCH_ERROR_URL);
return false;
}
- comma = strchr(slash, ',');
+
+ // doesn't exist in the filesystem but we should hit the internal types.
+ c->mimetype = strdup(fetch_filetype(slash));
c->name = strdup(slash + 1);
-
- if (!comma) {
- /* there is no mimetype here, assume text/plain */
- c->mimetype = strdup("text/plain;charset=US-ASCII");
- } else {
- /* make a copy of everything after the comma */
- c->mimetype = strdup(comma + 1);
- c->name[strlen(c->name) - strlen(comma)] = '\0';
- }
if (c->mimetype == NULL) {
fetch_rsrc_send_callback(FETCH_ERROR, c,
Modified: trunk/netsurf/beos/beos_filetype.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_filetype.cpp?re...
==============================================================================
--- trunk/netsurf/beos/beos_filetype.cpp (original)
+++ trunk/netsurf/beos/beos_filetype.cpp Mon Mar 21 16:15:58 2011
@@ -96,6 +96,18 @@
// NOT THREADSAFE
static char type[B_MIME_TYPE_LENGTH];
+ // override reading the mime type for known types
+ // avoids getting CSS files as text/x-source-code
+ // even though it's the mime sniffer rules that should be fixed.
+ BString ext(unix_path);
+ ext.Remove(0, ext.FindLast('.') + 1);
+ for (i = 0; default_types[i].type; i++) {
+ if (ext == default_types[i].ext1)
+ return default_types[i].type;
+ if (ext == default_types[i].ext2)
+ return default_types[i].type;
+ }
+
BEntry entry(unix_path, true);
BNode node(&entry);
err = node.InitCheck();
@@ -109,18 +121,6 @@
err = info.InitCheck();
if (err < B_OK)
return "test/plain";
-
- // override reading the mime type for known types
- // avoids getting CSS files as text/x-source-code
- // even though it's the mime sniffer rules that should be fixed.
- BString ext(unix_path);
- ext.Remove(0, ext.FindLast('.') + 1);
- for (i = 0; default_types[i].type; i++) {
- if (ext == default_types[i].ext1)
- return default_types[i].type;
- if (ext == default_types[i].ext2)
- return default_types[i].type;
- }
err = info.GetType(type);
if (err < B_OK) {
Modified: trunk/netsurf/beos/beos_gui.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_gui.cpp?rev=121...
==============================================================================
--- trunk/netsurf/beos/beos_gui.cpp (original)
+++ trunk/netsurf/beos/beos_gui.cpp Mon Mar 21 16:15:58 2011
@@ -616,7 +616,7 @@
/* set up stylesheet urls */
#ifdef USE_RESOURCES
- default_stylesheet_url = strdup("rsrc:/beosdefault.css,text/css");
+ default_stylesheet_url = strdup("rsrc:/beosdefault.css");
#else
find_resource(buf, "beosdefault.css", "./beos/res/beosdefault.css");
default_stylesheet_url = path_to_url(buf);
@@ -625,7 +625,7 @@
LOG(("Using '%s' as Default CSS URL", default_stylesheet_url));
#ifdef USE_RESOURCES
- quirks_stylesheet_url = strdup("rsrc:/quirks.css,text/css");
+ quirks_stylesheet_url = strdup("rsrc:/quirks.css");
#else
find_resource(buf, "quirks.css", "./beos/res/quirks.css");
default_stylesheet_url = path_to_url(buf);
@@ -633,7 +633,7 @@
#ifdef USE_RESOURCES
- adblock_stylesheet_url = strdup("rsrc:/adblock.css,text/css");
+ adblock_stylesheet_url = strdup("rsrc:/adblock.css");
#else
find_resource(buf, "adblock.css", "./beos/res/adblock.css");
adblock_stylesheet_url = path_to_url(buf);
Modified: trunk/netsurf/beos/beos_res.rdef
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_res.rdef?rev=12...
==============================================================================
--- trunk/netsurf/beos/beos_res.rdef (original)
+++ trunk/netsurf/beos/beos_res.rdef Mon Mar 21 16:15:58 2011
@@ -25,6 +25,8 @@
resource(204, "messages") #'data' import "res/messages";
/* resource(206, "about.en.html") #'data' import "res/about.en.html"; */
/* resource(210, "netsurf.xpm") #'data' import "res/netsurf.xpm"; */
+resource(205, "netsurf.png") #'data' import "res/netsurf.png";
+resource(206, "internal.css") #'data' import "res/internal.css";
/* throbber */
resource(400, "throbber0.png") #'data' import "res/throbber/throbber0.png";
@@ -36,6 +38,11 @@
resource(406, "throbber6.png") #'data' import "res/throbber/throbber6.png";
resource(407, "throbber7.png") #'data' import "res/throbber/throbber7.png";
resource(408, "throbber8.png") #'data' import "res/throbber/throbber8.png";
+
+/* */
+resource(500, "credits.html") #'data' import "res/en/credits.html,faf";
+resource(501, "licence.html") #'data' import "res/en/licence.html,faf";
+
resource(1, "BEOS:APP_FLAGS") (#'APPF') $"01000000";
Modified: trunk/netsurf/beos/res/beosdefault.css
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/res/beosdefault.css?...
==============================================================================
--- trunk/netsurf/beos/res/beosdefault.css (original)
+++ trunk/netsurf/beos/res/beosdefault.css Mon Mar 21 16:15:58 2011
@@ -5,7 +5,7 @@
/* Load base stylesheet. */
/*@import "default.css";*/
-@import "rsrc:/default.css,text/css";
+@import "rsrc:/default.css";
/* Apply GTK specific rules. */
Added: trunk/netsurf/beos/res/en
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/res/en?rev=12119&vie...
==============================================================================
--- trunk/netsurf/beos/res/en (added)
+++ trunk/netsurf/beos/res/en Mon Mar 21 16:15:58 2011
@@ -1,0 +1,1 @@
+link ../../!NetSurf/Resources/en
Propchange: trunk/netsurf/beos/res/en
------------------------------------------------------------------------------
svn:special = *
Added: trunk/netsurf/beos/res/internal.css
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/res/internal.css?rev...
==============================================================================
--- trunk/netsurf/beos/res/internal.css (added)
+++ trunk/netsurf/beos/res/internal.css Mon Mar 21 16:15:58 2011
@@ -1,0 +1,1 @@
+link ../../!NetSurf/Resources/internal.css,f79
Propchange: trunk/netsurf/beos/res/internal.css
------------------------------------------------------------------------------
svn:special = *
Added: trunk/netsurf/beos/res/netsurf.png
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/res/netsurf.png?rev=...
==============================================================================
--- trunk/netsurf/beos/res/netsurf.png (added)
+++ trunk/netsurf/beos/res/netsurf.png Mon Mar 21 16:15:58 2011
@@ -1,0 +1,1 @@
+link ../../!NetSurf/Resources/netsurf.png,b60
Propchange: trunk/netsurf/beos/res/netsurf.png
------------------------------------------------------------------------------
svn:special = *
12 years, 2 months
r12118 chris_y - /trunk/netsurf/image/webp.c
by netsurf@semichrome.net
Author: chris_y
Date: Mon Mar 21 15:28:33 2011
New Revision: 12118
URL: http://source.netsurf-browser.org?rev=12118&view=rev
Log:
Fix compilation
Modified:
trunk/netsurf/image/webp.c
Modified: trunk/netsurf/image/webp.c
URL: http://source.netsurf-browser.org/trunk/netsurf/image/webp.c?rev=12118&r1...
==============================================================================
--- trunk/netsurf/image/webp.c (original)
+++ trunk/netsurf/image/webp.c Mon Mar 21 15:28:33 2011
@@ -46,14 +46,13 @@
union content_msg_data msg_data;
const uint8_t *data;
unsigned char *imagebuf = NULL;
- uint32_t *imagebufptr = NULL;
unsigned long size;
int width = 0, height = 0;
char title[100];
int res = 0;
uint8_t *res_p = NULL;
- data = (uint8 *)content__get_source_data(c, &size);
+ data = (uint8_t *)content__get_source_data(c, &size);
res = WebPGetInfo(data, size, &width, &height);
if (res == 0) {
12 years, 2 months