hjfs: fix the megashit

aiju → what is this huge if(d != nil) {} megashit

if getdent() fails in newentry() then return immidiately
and dont override the error string.
This commit is contained in:
cinap_lenrek 2013-03-14 20:55:16 +01:00
parent f0303b65ca
commit 42224f7e5b

View file

@ -972,9 +972,10 @@ newentry(Fs *fs, Loc *l, Buf *b, char *name, FLoc *res, int dump)
int j, sj;
Buf *c;
si = sj = -1;
d = getdent(l, b);
if(d != nil){
if(d == nil)
return -1;
si = sj = -1;
for(i = 0; i < d->size; i++){
if(getblk(fs, l, b, i, &r, GBREAD) <= 0)
continue;
@ -1014,7 +1015,6 @@ newentry(Fs *fs, Loc *l, Buf *b, char *name, FLoc *res, int dump)
}
}
}
}
if(si == -1 || sj == -1){
werrstr("phase error -- create");
return -1;