Check-in [c0955e27e6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix boolean testing eating a char when true
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | scgi
Files: files | file ages | folders
SHA1:c0955e27e6758117d22fe747fbb25bd5c0aded7f
User & Date: bapt 2015-04-23 15:52:11
Context
2015-04-23
16:01
if string is empty consider it as false check-in: bffa15ec7c user: bapt tags: scgi
15:52
Fix boolean testing eating a char when true check-in: c0955e27e6 user: bapt tags: scgi
15:00
Fossil browsing by date check-in: b97cc42edd user: bapt tags: scgi
Changes

Changes to web/ucltpl.c.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	if (pos == NULL) /* improve error messages */
		return (walk);

	if (k == '#') {
		if (obj == NULL)
			return (pos + sz -1);
		if (obj->type == UCL_BOOLEAN && !ucl_object_toboolean(obj))
			return (pos + sz -1 );
		if (obj->type == UCL_NULL)
			return (pos + sz - 1);
		if (obj->type == UCL_ARRAY) {
			it = NULL;
			while ((o = ucl_iterate_object(obj, &it, true)))
				ucltpl_process_buffer(p, walk, pos - 1, o);
			return (pos + sz -1 );
................................................................................
	if (memchr(walk, '\n', pos - walk) != NULL)
		return (orig);

	if (strchr("!#^/", *walk) != NULL)
		key = *walk;

	if (key == '!' || key == '/') /* ignore comments */
		return (pos + 2);

	if (key != '0')
		walk++;

	if (walk == pos)
		return (orig);








|







 







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
	if (pos == NULL) /* improve error messages */
		return (walk);

	if (k == '#') {
		if (obj == NULL)
			return (pos + sz -1);
		if (obj->type == UCL_BOOLEAN && !ucl_object_toboolean(obj))
			return (pos + sz - 1 );
		if (obj->type == UCL_NULL)
			return (pos + sz - 1);
		if (obj->type == UCL_ARRAY) {
			it = NULL;
			while ((o = ucl_iterate_object(obj, &it, true)))
				ucltpl_process_buffer(p, walk, pos - 1, o);
			return (pos + sz -1 );
................................................................................
	if (memchr(walk, '\n', pos - walk) != NULL)
		return (orig);

	if (strchr("!#^/", *walk) != NULL)
		key = *walk;

	if (key == '!' || key == '/') /* ignore comments */
		return (pos + 1);

	if (key != '0')
		walk++;

	if (walk == pos)
		return (orig);