User panel stuff on forum
  2 posts on 1 page  1
Client Talk
2013-05-17, 12:37
Member
188 posts

Registered:
Feb 2008
For the demo browser of ezquake never worked properly (missing entries, no way out of an empty dir etc.)
Reason (at least 1 reason is wrong usage of strncmp in sys_linux.c, fix below:

--- sys_linux.c.orig 2013-05-17 14:29:33.817632315 +0200
+++ sys_linux.c 2013-05-17 14:30:03.985633882 +0200
@@ -195,7 +195,7 @@
memset(&dir, 0, sizeof(dir));

dir.files = list;
- all = !strncmp(ext, ".*", 3);
+ all = !strncmp(ext, ".*", 2);
if (!all)
if (!(preg = pcre_compile(ext, PCRE_CASELESS, &errbuf, &r, NULL)))
{
@@ -213,7 +213,7 @@
}
while ((oneentry = readdir(d)))
{
- if (!strncmp(oneentry->d_name, ".", 2) || !strncmp(oneentry->d_name, "..", 3))
+ if (!strncmp(oneentry->d_name, ".", 1) || !strncmp(oneentry->d_name, "..", 2))
continue;
if (!all)
{


Works fine here so far (I use dimman's jquake but that has the same mistakes).
2013-05-17, 20:01
Member
188 posts

Registered:
Feb 2008
actually the use of strncmp is wrong here, should be strcmp anyway
  2 posts on 1 page  1