Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/4bbf2ac58af4a660d108e...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/4bbf2ac58af4a660d108ec5...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/4bbf2ac58af4a660d108ec518...
The branch, master has been updated
via 4bbf2ac58af4a660d108ec51867a7cf8e674cc39 (commit)
from cba6bdb481545e404e0769b051090b16046a99f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=4bbf2ac58af4a660d10...
commit 4bbf2ac58af4a660d108ec51867a7cf8e674cc39
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Avoid accessing NULL pointer
diff --git a/amiga/gui.c b/amiga/gui.c
index f386b62..07fded3 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -346,13 +346,14 @@ bool ami_locate_resource(char *fullpath, const char *file)
/* Check NetSurf user data area first */
- strcpy(fullpath, current_user_dir);
- found = ami_gui_check_resource(fullpath, file);
- if(found) return true;
+ if(current_user_dir != NULL) {
+ strcpy(fullpath, current_user_dir);
+ found = ami_gui_check_resource(fullpath, file);
+ if(found) return true;
+ }
/* Check current theme directory */
- if(nsoption_charp(theme))
- {
+ if(nsoption_charp(theme)) {
strcpy(fullpath, nsoption_charp(theme));
found = ami_gui_check_resource(fullpath, file);
if(found) return true;
@@ -362,28 +363,23 @@ bool ami_locate_resource(char *fullpath, const char *file)
locale = OpenLocale(NULL);
- for(i=0;i<10;i++)
- {
+ for(i=0;i<10;i++) {
strcpy(fullpath,"PROGDIR:Resources/");
- if(locale->loc_PrefLanguages[i])
- {
+ if(locale->loc_PrefLanguages[i]) {
ami_gui_map_filename(&remapped, "PROGDIR:Resources",
locale->loc_PrefLanguages[i], "LangNames");
netsurf_mkpath(&fullpath, &fullpath_len, 2, fullpath, remapped);
found = ami_gui_check_resource(fullpath, file);
- }
- else
- {
+ } else {
continue;
}
if(found) break;
}
- if(!found)
- {
+ if(!found) {
/* If not found yet, check in PROGDIR:Resources/en,
* might not be in user's preferred languages */
@@ -393,8 +389,7 @@ bool ami_locate_resource(char *fullpath, const char *file)
CloseLocale(locale);
- if(!found)
- {
+ if(!found) {
/* Lastly check directly in PROGDIR:Resources */
strcpy(fullpath, "PROGDIR:Resources/");
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index f386b62..07fded3 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -346,13 +346,14 @@ bool ami_locate_resource(char *fullpath, const char *file)
/* Check NetSurf user data area first */
- strcpy(fullpath, current_user_dir);
- found = ami_gui_check_resource(fullpath, file);
- if(found) return true;
+ if(current_user_dir != NULL) {
+ strcpy(fullpath, current_user_dir);
+ found = ami_gui_check_resource(fullpath, file);
+ if(found) return true;
+ }
/* Check current theme directory */
- if(nsoption_charp(theme))
- {
+ if(nsoption_charp(theme)) {
strcpy(fullpath, nsoption_charp(theme));
found = ami_gui_check_resource(fullpath, file);
if(found) return true;
@@ -362,28 +363,23 @@ bool ami_locate_resource(char *fullpath, const char *file)
locale = OpenLocale(NULL);
- for(i=0;i<10;i++)
- {
+ for(i=0;i<10;i++) {
strcpy(fullpath,"PROGDIR:Resources/");
- if(locale->loc_PrefLanguages[i])
- {
+ if(locale->loc_PrefLanguages[i]) {
ami_gui_map_filename(&remapped, "PROGDIR:Resources",
locale->loc_PrefLanguages[i], "LangNames");
netsurf_mkpath(&fullpath, &fullpath_len, 2, fullpath, remapped);
found = ami_gui_check_resource(fullpath, file);
- }
- else
- {
+ } else {
continue;
}
if(found) break;
}
- if(!found)
- {
+ if(!found) {
/* If not found yet, check in PROGDIR:Resources/en,
* might not be in user's preferred languages */
@@ -393,8 +389,7 @@ bool ami_locate_resource(char *fullpath, const char *file)
CloseLocale(locale);
- if(!found)
- {
+ if(!found) {
/* Lastly check directly in PROGDIR:Resources */
strcpy(fullpath, "PROGDIR:Resources/");
--
NetSurf Browser