commit 9bc519d686f2f3451e07ce5d814b3a85306a414d from: rsc date: Mon Jun 26 05:49:18 2006 UTC fix dup file name bug commit - ff63eeb1bd16c9fafe72d14edc410ccb18349cfc commit + 9bc519d686f2f3451e07ce5d814b3a85306a414d blob - 120c53acdf167a9ad053ae79cb6e20eb699281c9 blob + f180290bbe650cff628a8f8f4104d514e9568a87 --- src/cmd/sam/sam.c +++ src/cmd/sam/sam.c @@ -532,13 +532,22 @@ cd(String *str) Strduplstr(&owd, &curwd); getcurwd(); settempfile(); + /* + * Two passes so that if we have open + * /a/foo.c and /b/foo.c and cd from /b to /a, + * we don't ever have two foo.c simultaneously. + */ for(i=0; iname.s[0]!='/' && f->name.s[0]!=0){ Strinsert(&f->name, &owd, (Posn)0); fixname(&f->name); sortname(f); - }else if(f != cmd && Strispre(&curwd, &f->name)){ + } + } + for(i=0; iname)){ fixname(&f->name); sortname(f); }