summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-06-26 16:26:05 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-06-26 16:26:05 +0000
commitd36758ad9768e5f746b82f7f88ea86361365de52 (patch)
tree91d4849178ebdaa22815258d24ef3ad72ab7b1fe
parentcd8e367ce47c6b52f9119db015b755c15712b218 (diff)
downloadnetsurf-d36758ad9768e5f746b82f7f88ea86361365de52.tar.gz
netsurf-d36758ad9768e5f746b82f7f88ea86361365de52.tar.bz2
Fix some types
If "easy" charset conversion fails, return a copy of the original string. svn path=/trunk/netsurf/; revision=10580
-rwxr-xr-xamiga/gui.c35
-rw-r--r--amiga/stringview/urlhistory.c2
-rwxr-xr-xamiga/utf8.c10
3 files changed, 25 insertions, 22 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index c78967ebd..a3200bc18 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2950,26 +2950,29 @@ void gui_window_set_title(struct gui_window *g, const char *title)
{
node = g->tab_node;
- SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
- g->shared->win, NULL,
- CLICKTAB_Labels, ~0,
- TAG_DONE);
-
- SetClickTabNodeAttrs(node, TNA_Text, utf8title,
- TNA_HintInfo, utf8title,
- TAG_DONE);
-
- RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
+ if((g->tabtitle == NULL) || (strcmp(utf8title, g->tabtitle)))
+ {
+ SetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
g->shared->win, NULL,
- CLICKTAB_Labels, &g->shared->tab_list,
+ CLICKTAB_Labels, ~0,
TAG_DONE);
- if(g->tabtitle) ami_utf8_free(g->tabtitle);
- g->tabtitle = utf8title;
+ SetClickTabNodeAttrs(node, TNA_Text, utf8title,
+ TNA_HintInfo, utf8title,
+ TAG_DONE);
- if(ClickTabBase->lib_Version < 53)
- RethinkLayout((struct Gadget *)g->shared->objects[GID_TABLAYOUT],
- g->shared->win, NULL, TRUE);
+ RefreshSetGadgetAttrs((struct Gadget *)g->shared->objects[GID_TABS],
+ g->shared->win, NULL,
+ CLICKTAB_Labels, &g->shared->tab_list,
+ TAG_DONE);
+
+ if(g->tabtitle) ami_utf8_free(g->tabtitle);
+ g->tabtitle = utf8title;
+
+ if(ClickTabBase->lib_Version < 53)
+ RethinkLayout((struct Gadget *)g->shared->objects[GID_TABLAYOUT],
+ g->shared->win, NULL, TRUE);
+ }
GetAttr(CLICKTAB_Current, g->shared->objects[GID_TABS],
(ULONG *)&cur_tab);
diff --git a/amiga/stringview/urlhistory.c b/amiga/stringview/urlhistory.c
index 65e96e2a2..b8a0168db 100644
--- a/amiga/stringview/urlhistory.c
+++ b/amiga/stringview/urlhistory.c
@@ -29,7 +29,7 @@
#include "content/urldb.h"
#include "desktop/options.h"
-struct List PageList;
+static struct List PageList;
void URLHistory_Init( void )
{
diff --git a/amiga/utf8.c b/amiga/utf8.c
index bb94c6390..5609be348 100755
--- a/amiga/utf8.c
+++ b/amiga/utf8.c
@@ -25,12 +25,12 @@
utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
char **result)
{
- ULONG *charset;
+ LONG charset;
char *encname;
charset = GetDiskFontCtrl(DFCTRL_CHARSET);
encname = ObtainCharsetInfo(DFCS_NUMBER, charset, DFCS_MIMENAME);
-
+
return utf8_to_enc(string,encname,len,result);
}
@@ -49,7 +49,7 @@ char *ami_utf8_easy(char *string)
}
else
{
- return NULL;
+ return strdup(string);
}
}
@@ -63,14 +63,14 @@ char *ami_to_utf8_easy(char *string)
}
else
{
- return NULL;
+ return strdup(string);
}
}
utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
char **result)
{
- ULONG *charset;
+ LONG charset;
char *encname;
charset = GetDiskFontCtrl(DFCTRL_CHARSET);