cifs buglet - take 2

"Steve Simon" <[email protected]>
Newsgroups gmane.os.plan9.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.