diff -Nrup ht-2.0.16.orig/htapp.cc ht-2.0.16/htapp.cc --- ht-2.0.16.orig/htapp.cc 2008-05-19 00:11:22.000000000 +0200 +++ ht-2.0.16/htapp.cc 2009-04-05 19:10:20.000000000 +0200 @@ -2962,7 +2962,7 @@ void ht_app::project_opencreate(const ch LOG("%s: invalid filename", filename); return; } - char *suf = sys_filename_suffix(fn); + const char *suf = sys_filename_suffix(fn); /* append HT project file suffix if not already there */ if (!(suf && (strcmp(suf, HT_PROJECT_CONFIG_SUFFIX+1)==0))) { strcat(fn, HT_PROJECT_CONFIG_SUFFIX); diff -Nrup ht-2.0.16.orig/htformat.cc ht-2.0.16/htformat.cc --- ht-2.0.16.orig/htformat.cc 2008-07-10 01:09:36.000000000 +0200 +++ ht-2.0.16/htformat.cc 2009-04-05 19:14:08.000000000 +0200 @@ -3916,7 +3916,7 @@ void ht_uformat_viewer::update_misc_info void ht_uformat_viewer::update_visual_info() { cursorline_get(); - char *s, *t = cursor_line; + const char *s, *t = cursor_line; int v = 0, vl = 0; int i = 0, g = 0; while ((s=tag_findnext(t))) { diff -Nrup ht-2.0.16.orig/htreg.cc ht-2.0.16/htreg.cc --- ht-2.0.16.orig/htreg.cc 2007-05-09 00:50:24.000000000 +0200 +++ ht-2.0.16/htreg.cc 2009-04-05 19:11:13.000000000 +0200 @@ -781,7 +781,7 @@ bool ht_registry::find_data_entry(const ht_registry_node *ht_registry::find_entry_i(Container **rdir, const char *key, bool follow_symlinks) { ht_registry_node *dir = root; - char *s; + const char *s; char t[256]; /* FIXME: possible buffer overflow */ if (key[0]=='/') key++; while (1) { diff -Nrup ht-2.0.16.orig/httag.cc ht-2.0.16/httag.cc --- ht-2.0.16.orig/httag.cc 2008-03-26 12:51:36.000000000 +0100 +++ ht-2.0.16/httag.cc 2009-04-05 19:12:33.000000000 +0200 @@ -537,7 +537,7 @@ void statictag_to_tag(const char *static *tag_str = 0; } -TAGSTRING *tag_findnext(const TAGSTRING *tagstring) +const TAGSTRING *tag_findnext(const TAGSTRING *tagstring) { return strchr(tagstring, '\e'); } diff -Nrup ht-2.0.16.orig/httag.h ht-2.0.16/httag.h --- ht-2.0.16.orig/httag.h 2007-05-09 01:30:13.000000000 +0200 +++ ht-2.0.16/httag.h 2009-04-05 19:12:48.000000000 +0200 @@ -447,7 +447,7 @@ typedef char TAGSTRING; void statictag_to_tag(const char *statictag_str, TAGSTRING *tag_str, int maxlen, uint64 relocation, bool std_bigendian); -TAGSTRING *tag_findnext(const TAGSTRING *tagstring); +const TAGSTRING *tag_findnext(const TAGSTRING *tagstring); vcp tag_get_color(const TAGSTRING *tagstring); void tag_get_id(const TAGSTRING *tagstring, uint32 *id128_1, uint32 *id128_2, uint32 *id128_3, uint32 *id128_4); diff -Nrup ht-2.0.16.orig/httext.cc ht-2.0.16/httext.cc --- ht-2.0.16.orig/httext.cc 2007-05-09 00:50:24.000000000 +0200 +++ ht-2.0.16/httext.cc 2009-04-05 19:15:03.000000000 +0200 @@ -103,6 +103,7 @@ void ht_text_viewer2::handlemsg(htmsg *m */ /* FIXME: put it somewhere else..., why ain't this a POSIX function ? */ +#if 0 void *memrchr(const void *string, int ch, size_t num) { while (num--) { @@ -110,6 +111,7 @@ void *memrchr(const void *string, int ch } return NULL; } +#endif #define TEXT_SUB_READSIZE 256 diff -Nrup ht-2.0.16.orig/info/infoview.cc ht-2.0.16/info/infoview.cc --- ht-2.0.16.orig/info/infoview.cc 2007-12-04 21:27:15.000000000 +0100 +++ ht-2.0.16/info/infoview.cc 2009-04-05 19:07:09.000000000 +0200 @@ -193,7 +193,7 @@ Container *parse_info_node(File *fl, con } else { fallback: if (k && k > n) { - char *cr = strchr(n, '\n'); + const char *cr = strchr(n, '\n'); if (cr && cr < k) k = cr; if (k-n == 0) goto fallback2; fl->write(n, k-n); @@ -423,11 +423,11 @@ int ht_info_viewer::find_node(const char const char *tags[] = {"File", "Node", "Prev", "Next", "Up"}; #define NUM_NODE_TAGS (sizeof (tags) / sizeof (tags[0])) const char *s = infotext; - char *firstnode = NULL; + const char *firstnode = NULL; while ((s=strchr(s, 0x1f))) { s++; while ((*s>0) && (*s<32)) s++; - char *cr = strchr(s, '\n'); + const char *cr = strchr(s, '\n'); if (cr) { while (*s && (scr)) e = cr; if (!firstnode && (strcmp(tags[i], "Node") == 0)) { firstnode = cr+1; diff -Nrup ht-2.0.16.orig/io/file.cc ht-2.0.16/io/file.cc --- ht-2.0.16.orig/io/file.cc 2008-03-05 16:52:27.000000000 +0100 +++ ht-2.0.16/io/file.cc 2009-04-05 19:09:21.000000000 +0200 @@ -210,9 +210,9 @@ static char *_env_replace(char *str, uns int sys_basename(char *result, const char *filename) { // FIXME: use is_path_delim - char *slash1 = strrchr(filename, '/'); - char *slash2 = strrchr(filename, '\\'); - char *slash = (slash1 > slash2) ? slash1 : slash2; + const char *slash1 = strrchr(filename, '/'); + const char *slash2 = strrchr(filename, '\\'); + const char *slash = (slash1 > slash2) ? slash1 : slash2; if (slash) { int l = strlen(filename); ht_strlcpy(result, slash+1, l-(slash-filename)+1); @@ -395,14 +395,14 @@ int sys_common_canonicalize(char *result return (k == 0) ? 0 : EINVAL; } -char *sys_filename_suffix(const char *fn) +const char *sys_filename_suffix(const char *fn) { const char *s = NULL; while (fn && *fn) { if (sys_is_path_delim(*fn)) s = fn+1; fn++; } - char *p = s ? strrchr(s, '.') : NULL; + const char *p = s ? strrchr(s, '.') : NULL; return p ? p+1 : NULL; } diff -Nrup ht-2.0.16.orig/io/file.h ht-2.0.16/io/file.h --- ht-2.0.16.orig/io/file.h 2007-12-04 21:27:15.000000000 +0100 +++ ht-2.0.16/io/file.h 2009-04-05 19:09:05.000000000 +0200 @@ -154,7 +154,7 @@ char * sys_dirname(char *path); char * sys_get_home_dir(); int sys_relname(char *result, const char *filename, const char *cwd); int sys_common_canonicalize(char *result, const char *in_name, const char *cwd, is_path_delim delim); -char * sys_filename_suffix(const char *fn); +const char * sys_filename_suffix(const char *fn); int sys_tmpfile_fd(); /* system-dependant (implementation in $MYSYSTEM/ *.cc) */