mirror of https://github.com/nealey/eris.git
Fix SEGV for dirindex of /. First bugfix, woo!
This commit is contained in:
parent
32714eb6c4
commit
db14145584
5
fnord.c
5
fnord.c
|
@ -1072,15 +1072,16 @@ static void
|
|||
handledirlist(const char *origurl)
|
||||
{
|
||||
DIR *dir;
|
||||
unsigned int nl = strlen(origurl);
|
||||
unsigned int nl;
|
||||
const char *nurl = origurl;
|
||||
|
||||
url = (char *) origurl;
|
||||
while (nurl[0] == '/')
|
||||
++nurl;
|
||||
if (nurl <= origurl)
|
||||
return;
|
||||
nl = strlen(nurl);
|
||||
if (nurl[nl - 1] != '/')
|
||||
if (nl && (nurl[nl - 1] != '/'))
|
||||
return;
|
||||
if (!stat(nl ? nurl : ".", &st) && (S_ISDIR(st.st_mode))
|
||||
&& ((st.st_mode & S_IRWXO) == 5)) {
|
||||
|
|
Loading…
Reference in New Issue