From: Russ Cox Date: Mon, 6 Feb 2012 18:33:22 +0000 (-0500) Subject: cmd/dist: ignore file names beginning with . or _ X-Git-Tag: weekly.2012-02-07~32 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e335ec98b5f897afee90462bd95cf3cec42e115a;p=gostls13.git cmd/dist: ignore file names beginning with . or _ This is the same heuristic that build.ScanDir uses. It avoids considering 'resource fork' files on OS X; the resource for x.go is ._x.go. R=gri CC=golang-dev https://golang.org/cl/5616073 --- diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c index 04818e1265..54510db1da 100644 --- a/src/cmd/dist/build.c +++ b/src/cmd/dist/build.c @@ -555,6 +555,22 @@ install(char *dir) // Everything in that directory, and any target-specific // additions. xreaddir(&files, bstr(&path)); + + // Remove files beginning with . or _, + // which are likely to be editor temporary files. + // This is the same heuristic build.ScanDir uses. + // There do exist real C files beginning with _, + // so limit that check to just Go files. + n = 0; + for(i=0; i