summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c16
-rwxr-xr-xamiga/misc.c21
-rw-r--r--amiga/misc.h2
3 files changed, 14 insertions, 25 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index a21c20ee1..136034987 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2620,21 +2620,21 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->shared->svbuffer = AllocVec(2000, MEMF_CLEAR);
g->shared->helphints[GID_BACK] =
- remove_escape_chars(messages_get("HelpToolbar0"), true);
+ translate_escape_chars(messages_get("HelpToolbarBack"));
g->shared->helphints[GID_FORWARD] =
- remove_escape_chars(messages_get("HelpToolbar1"), true);
+ translate_escape_chars(messages_get("HelpToolbarForward"));
g->shared->helphints[GID_STOP] =
- remove_escape_chars(messages_get("HelpToolbar2"), true);
+ translate_escape_chars(messages_get("HelpToolbarStop"));
g->shared->helphints[GID_RELOAD] =
- remove_escape_chars(messages_get("HelpToolbar3"), true);
+ translate_escape_chars(messages_get("HelpToolbarReload"));
g->shared->helphints[GID_HOME] =
- remove_escape_chars(messages_get("HelpToolbar4"), true);
+ translate_escape_chars(messages_get("HelpToolbarHome"));
g->shared->helphints[GID_URL] =
- remove_escape_chars(messages_get("HelpToolbar14"), true);
+ translate_escape_chars(messages_get("HelpToolbarURL"));
g->shared->helphints[GID_SEARCHSTRING] =
- remove_escape_chars(messages_get("HelpWebSearch"), true);
+ translate_escape_chars(messages_get("HelpToolbarWebSearch"));
g->shared->helphints[GID_ADDTAB] =
- remove_escape_chars(messages_get("HelpAddTab"), true);
+ translate_escape_chars(messages_get("HelpToolbarAddTab"));
ami_get_theme_filename(nav_west,"theme_nav_west",false);
ami_get_theme_filename(nav_west_s,"theme_nav_west_s",false);
diff --git a/amiga/misc.c b/amiga/misc.c
index bfb281718..affb65197 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -155,37 +155,26 @@ bool path_add_part(char *path, int length, const char *newpart)
}
/**
- * returns a string without escape chars or |M chars.
+ * returns a string with escape chars translated.
* (based on remove_underscores from utils.c)
- * \param translate true to insert a linebreak where there was |M,
- * and capitalise initial characters after escape chars.
*/
-char *remove_escape_chars(const char *s, bool translate)
+char *translate_escape_chars(const char *s)
{
size_t i, ii, len;
char *ret;
- bool nextcharupper = false;
len = strlen(s);
ret = malloc(len + 1);
if (ret == NULL)
return NULL;
for (i = 0, ii = 0; i < len; i++) {
- if ((s[i] != '\\') && (s[i] != '|')) {
- if(nextcharupper) {
- ret[ii++] = toupper(s[i]);
- nextcharupper = false;
- }
- else ret[ii++] = s[i];
+ if (s[i] != '\\') {
+ ret[ii++] = s[i];
}
- else if ((translate) && (s[i] == '|') && (s[i+1] == 'M')) {
+ else if (s[i+1] == 'n') {
ret[ii++] = '\n';
i++;
}
- else {
- if(translate) nextcharupper = true;
- i++;
- }
}
ret[ii] = '\0';
return ret;
diff --git a/amiga/misc.h b/amiga/misc.h
index beeb4f2b8..c863c7966 100644
--- a/amiga/misc.h
+++ b/amiga/misc.h
@@ -18,5 +18,5 @@
#ifndef AMIGA_MISC_H
#define AMIGA_MISC_H
-char *remove_escape_chars(const char *s, bool translate);
+char *translate_escape_chars(const char *s);
#endif