sorry, I generated the diff on the wrong server, slightly safer fix below

diff /n/dump/2019/0205/sys/src/cmd/cifs/main.c /sys/src/cmd/cifs/main.c
261,265c261,264
<               if(got >= 2 && strcmp(fi[0].name, ".") == 0 &&
<                   strcmp(fi[1].name, "..") == 0){
<                       a->end = (got - 2) * sizeof(FInfo);
<                       memmove(a->cache, a->cache + sizeof(FInfo)*2,
<                               a->end - a->off);
---
>               while(got > 0 && strcmp(fi[0].name, ".") == 0 || 
> strcmp(fi[0].name, "..") == 0){
>                       got--;
>                       a->end = got * sizeof(FInfo);
>                       memmove(a->cache, a->cache + sizeof(FInfo), a->end - 
> a->off);

-Steve

Reply via email to