diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-05-07 15:06:48 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2012-05-07 15:06:48 +0000 |
commit | 36e9d114ea6d6536ee7cbc2349c4cb3d78a392e9 (patch) | |
tree | 6c7ae10a6720018b63a07c9822625e23ddf435e5 /amiga/misc.c | |
parent | 9e03315e0917703e9f924c017b205c2d09f4b22c (diff) | |
download | netsurf-36e9d114ea6d6536ee7cbc2349c4cb3d78a392e9.tar.gz netsurf-36e9d114ea6d6536ee7cbc2349c4cb3d78a392e9.tar.bz2 |
Stop abusing certain Messages; add some dedicated non-crazy HelpHints
svn path=/trunk/netsurf/; revision=13912
Diffstat (limited to 'amiga/misc.c')
-rwxr-xr-x | amiga/misc.c | 21 |
1 files changed, 5 insertions, 16 deletions
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; |