Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 324353
Collapse All | Expand All

(-)ht-2.0.10/htapp.cc (-1 / +1 lines)
Lines 2959-2965 Link Here
2959
		LOG("%s: invalid filename", filename);
2959
		LOG("%s: invalid filename", filename);
2960
		return;
2960
		return;
2961
	}
2961
	}
2962
	char *suf = sys_filename_suffix(fn);
2962
	const char *suf = sys_filename_suffix(fn);
2963
	/* append HT project file suffix if not already there */
2963
	/* append HT project file suffix if not already there */
2964
	if (!(suf && (strcmp(suf, HT_PROJECT_CONFIG_SUFFIX+1)==0))) {
2964
	if (!(suf && (strcmp(suf, HT_PROJECT_CONFIG_SUFFIX+1)==0))) {
2965
		strcat(fn, HT_PROJECT_CONFIG_SUFFIX);
2965
		strcat(fn, HT_PROJECT_CONFIG_SUFFIX);
(-)ht-2.0.10/htformat.cc (-1 / +1 lines)
Lines 3891-3897 Link Here
3891
void ht_uformat_viewer::update_visual_info()
3891
void ht_uformat_viewer::update_visual_info()
3892
{
3892
{
3893
	cursorline_get();
3893
	cursorline_get();
3894
	char *s, *t = cursor_line;
3894
	const char *s, *t = cursor_line;
3895
	int v = 0, vl = 0;
3895
	int v = 0, vl = 0;
3896
	int i = 0, g = 0;
3896
	int i = 0, g = 0;
3897
	while ((s=tag_findnext(t))) {
3897
	while ((s=tag_findnext(t))) {
(-)ht-2.0.10/htreg.cc (-1 / +1 lines)
Lines 781-787 Link Here
781
ht_registry_node *ht_registry::find_entry_i(Container **rdir, const char *key, bool follow_symlinks)
781
ht_registry_node *ht_registry::find_entry_i(Container **rdir, const char *key, bool follow_symlinks)
782
{
782
{
783
	ht_registry_node *dir = root;
783
	ht_registry_node *dir = root;
784
	char *s;
784
	const char *s;
785
	char t[256]; /* FIXME: possible buffer overflow */
785
	char t[256]; /* FIXME: possible buffer overflow */
786
	if (key[0]=='/') key++;
786
	if (key[0]=='/') key++;
787
	while (1) {
787
	while (1) {
(-)ht-2.0.10/httag.cc (-1 / +1 lines)
Lines 524-530 Link Here
524
	*tag_str = 0;
524
	*tag_str = 0;
525
}
525
}
526
526
527
TAGSTRING *tag_findnext(const TAGSTRING *tagstring)
527
const TAGSTRING *tag_findnext(const TAGSTRING *tagstring)
528
{
528
{
529
	return strchr(tagstring, '\e');
529
	return strchr(tagstring, '\e');
530
}
530
}
(-)ht-2.0.10/httag.h (-1 / +1 lines)
Lines 447-453 Link Here
447
447
448
void statictag_to_tag(const char *statictag_str, TAGSTRING *tag_str, int maxlen, uint64 relocation, bool std_bigendian);
448
void statictag_to_tag(const char *statictag_str, TAGSTRING *tag_str, int maxlen, uint64 relocation, bool std_bigendian);
449
449
450
TAGSTRING *tag_findnext(const TAGSTRING *tagstring);
450
const TAGSTRING *tag_findnext(const TAGSTRING *tagstring);
451
451
452
vcp tag_get_color(const TAGSTRING *tagstring);
452
vcp tag_get_color(const TAGSTRING *tagstring);
453
void tag_get_id(const TAGSTRING *tagstring, uint32 *id128_1, uint32 *id128_2, uint32 *id128_3, uint32 *id128_4);
453
void tag_get_id(const TAGSTRING *tagstring, uint32 *id128_1, uint32 *id128_2, uint32 *id128_3, uint32 *id128_4);
(-)ht-2.0.10/httext.cc (-1 / +1 lines)
Lines 103-109 Link Here
103
 */
103
 */
104
104
105
/* FIXME: put it somewhere else..., why ain't this a POSIX function ? */
105
/* FIXME: put it somewhere else..., why ain't this a POSIX function ? */
106
void *memrchr(const void *string, int ch, size_t num)
106
const void *memrchr(const void *string, int ch, size_t num)
107
{
107
{
108
	while (num--) {
108
	while (num--) {
109
		if (((char*)string)[num]==ch) return ((char*)string)+num;
109
		if (((char*)string)[num]==ch) return ((char*)string)+num;
(-)ht-2.0.10/info/infoview.cc (-4 / +4 lines)
Lines 193-199 Link Here
193
		} else {
193
		} else {
194
fallback:
194
fallback:
195
			if (k && k > n) {
195
			if (k && k > n) {
196
				char *cr = strchr(n, '\n');
196
				const char *cr = strchr(n, '\n');
197
				if (cr && cr < k) k = cr;
197
				if (cr && cr < k) k = cr;
198
				if (k-n == 0) goto fallback2;
198
				if (k-n == 0) goto fallback2;
199
				fl->write(n, k-n);
199
				fl->write(n, k-n);
Lines 423-433 Link Here
423
	const char *tags[] = {"File", "Node", "Prev", "Next", "Up"};
423
	const char *tags[] = {"File", "Node", "Prev", "Next", "Up"};
424
#define NUM_NODE_TAGS (sizeof (tags) / sizeof (tags[0]))
424
#define NUM_NODE_TAGS (sizeof (tags) / sizeof (tags[0]))
425
	const char *s = infotext;
425
	const char *s = infotext;
426
	char *firstnode = NULL;
426
	const char *firstnode = NULL;
427
	while ((s=strchr(s, 0x1f))) {
427
	while ((s=strchr(s, 0x1f))) {
428
		s++;
428
		s++;
429
		while ((*s>0) && (*s<32)) s++;
429
		while ((*s>0) && (*s<32)) s++;
430
		char *cr = strchr(s, '\n');
430
		const char *cr = strchr(s, '\n');
431
		if (cr) {
431
		if (cr) {
432
			while (*s && (s<cr)) {
432
			while (*s && (s<cr)) {
433
				whitespaces(s);
433
				whitespaces(s);
Lines 437-443 Link Here
437
					if (ht_strncmp(s, tags[i], l) == 0 && s[l] == ':') {
437
					if (ht_strncmp(s, tags[i], l) == 0 && s[l] == ':') {
438
						s += l+1;
438
						s += l+1;
439
						whitespaces(s);
439
						whitespaces(s);
440
						char *e = strchr(s, ',');
440
						const char *e = strchr(s, ',');
441
						if (!e || (e>cr)) e = cr;
441
						if (!e || (e>cr)) e = cr;
442
						if (!firstnode && (strcmp(tags[i], "Node") == 0)) {
442
						if (!firstnode && (strcmp(tags[i], "Node") == 0)) {
443
							firstnode = cr+1;
443
							firstnode = cr+1;
(-)ht-2.0.10/io/file.cc (-8 / +8 lines)
Lines 128-136 Link Here
128
int sys_basename(char *result, const char *filename)
128
int sys_basename(char *result, const char *filename)
129
{
129
{
130
	// FIXME: use is_path_delim
130
	// FIXME: use is_path_delim
131
	char *slash1 = strrchr(filename, '/');
131
	const char *slash1 = strrchr(filename, '/');
132
	char *slash2 = strrchr(filename, '\\');
132
	const char *slash2 = strrchr(filename, '\\');
133
	char *slash = (slash1 > slash2) ? slash1 : slash2;
133
	const char *slash = (slash1 > slash2) ? slash1 : slash2;
134
	if (slash) {
134
	if (slash) {
135
		int l = strlen(filename);
135
		int l = strlen(filename);
136
		ht_strlcpy(result, slash+1, l-(slash-filename)+1);
136
		ht_strlcpy(result, slash+1, l-(slash-filename)+1);
Lines 143-151 Link Here
143
int sys_dirname(char *result, const char *filename)
143
int sys_dirname(char *result, const char *filename)
144
{
144
{
145
	// FIXME: use is_path_delim
145
	// FIXME: use is_path_delim
146
	char *slash1 = strrchr(filename, '/');
146
	const char *slash1 = strrchr(filename, '/');
147
	char *slash2 = strrchr(filename, '\\');
147
	const char *slash2 = strrchr(filename, '\\');
148
	char *slash = (slash1 > slash2) ? slash1 : slash2;
148
	const char *slash = (slash1 > slash2) ? slash1 : slash2;
149
	if (slash) {
149
	if (slash) {
150
		ht_strlcpy(result, filename, slash-filename+1);
150
		ht_strlcpy(result, filename, slash-filename+1);
151
		return 0;
151
		return 0;
Lines 263-276 Link Here
263
	return (k == 0) ? 0 : EINVAL;
263
	return (k == 0) ? 0 : EINVAL;
264
}
264
}
265
265
266
char *sys_filename_suffix(const char *fn)
266
const char *sys_filename_suffix(const char *fn)
267
{
267
{
268
	const char *s = NULL;
268
	const char *s = NULL;
269
	while (fn && *fn) {
269
	while (fn && *fn) {
270
		if (sys_is_path_delim(*fn)) s = fn+1;
270
		if (sys_is_path_delim(*fn)) s = fn+1;
271
		fn++;
271
		fn++;
272
	}
272
	}
273
	char *p = s ? strrchr(s, '.') : NULL;
273
	const char *p = s ? strrchr(s, '.') : NULL;
274
	return p ? p+1 : NULL;
274
	return p ? p+1 : NULL;
275
}
275
}
276
276
(-)ht-2.0.10/io/file.h (-1 / +1 lines)
Lines 151-157 Link Here
151
int		sys_dirname(char *result, const char *filename);
151
int		sys_dirname(char *result, const char *filename);
152
int		sys_relname(char *result, const char *filename, const char *cwd);
152
int		sys_relname(char *result, const char *filename, const char *cwd);
153
int		sys_common_canonicalize(char *result, const char *in_name, const char *cwd, is_path_delim delim);
153
int		sys_common_canonicalize(char *result, const char *in_name, const char *cwd, is_path_delim delim);
154
char *		sys_filename_suffix(const char *fn);
154
const char *		sys_filename_suffix(const char *fn);
155
int		sys_tmpfile_fd();
155
int		sys_tmpfile_fd();
156
156
157
/* system-dependant (implementation in $MYSYSTEM/ *.cc) */
157
/* system-dependant (implementation in $MYSYSTEM/ *.cc) */

Return to bug 324353