summaryrefslogtreecommitdiff
path: root/src/path
Commit message (Collapse)AuthorAgeFilesLines
* path/filepath: fix TestGlobErrorDominik Honnef2017-06-151-2/+2
| | | | | | | | Change-Id: I7776547332066e1d7651e9aa06eec301dfaf38bc Reviewed-on: https://go-review.googlesource.com/45892 Reviewed-by: Rob Pike <r@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path, path/filepath: clarify and cross-reference packagesBrad Fitzpatrick2017-06-142-1/+9
| | | | | | | | | | | | | | The path package has a reference to the path/filepath package, so add a reverse reference. And clarify the path package doesn't do Windows paths. Fixes #20117 Change-Id: I65c5ce24e600b32ea20c5821b744bd89f6aff98c Reviewed-on: https://go-review.googlesource.com/45653 Reviewed-by: Jaana Burcu Dogan <jbd@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* path: add examplesMark Harrison2017-05-161-6/+34
| | | | | | | | | | | This change adds several examples, with emphasis on special or edge cases such as a directory parameter consisting of an empty string. Change-Id: Ib4ac3d0f6d503493eeed0c4fda7c12acf782e9e2 Reviewed-on: https://go-review.googlesource.com/43010 Reviewed-by: Steve Francia <spf@golang.org> Run-TryBot: Jaana Burcu Dogan <jbd@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* os: do not report ModeDir for symlinks on windowsAlex Brainman2017-04-262-5/+0
| | | | | | | | | | | | | | | | | When using Lstat against symlinks that point to a directory, the function returns FileInfo with both ModeDir and ModeSymlink set. Change that to never set ModeDir if ModeSymlink is set. Fixes #10424 Fixes #17540 Fixes #17541 Change-Id: Iba280888aad108360b8c1f18180a24493fe7ad2b Reviewed-on: https://go-review.googlesource.com/41830 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: remove some unused parameters in test codeDaniel Martí2017-04-251-2/+2
| | | | | | | | | | | | Mostly unnecessary *testing.T arguments. Found with github.com/mvdan/unparam. Change-Id: Ifb955cb88f2ce8784ee4172f4f94d860fa36ae9a Reviewed-on: https://go-review.googlesource.com/41691 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* path/filepath: add test to walk symlinkAlex Brainman2017-04-052-35/+75
| | | | | | | | | | For #17540. Change-Id: Ie01f39797526934fa553f4279cbde6c7cbf14154 Reviewed-on: https://go-review.googlesource.com/36854 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: add test for directory junction walkAlex Brainman2017-02-121-0/+42
| | | | | | | | | | For #10424. Change-Id: Ie4e87503b0ed04f65d2444652bd1db647d3529f4 Reviewed-on: https://go-review.googlesource.com/36851 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: fix TestWinSplitListTestsAreValid on some systemsRemi Gillig2017-02-111-1/+4
| | | | | | | | | | | | | | The environment variables used in those tests override the default OS ones. However, one of them (SystemRoot) seems to be required on some Windows systems for invoking cmd.exe properly. This fixes #4930 and #6568. Change-Id: I23dfb67c1de86020711a3b59513f6adcbba12561 Reviewed-on: https://go-review.googlesource.com/36873 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: ignore dot for Dir(`\\server\share`)Yasuhiro Matsumoto2017-02-042-0/+5
| | | | | | | | | | | | | Dir(`\\server\share`) returns `\\server\share.`. Change Dir so it returns `\\server\share` instead. Fixes #18783 Change-Id: I9e0dd71ea6aea85e6c6114aaa4bb3bea3270d818 Reviewed-on: https://go-review.googlesource.com/35690 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: fix misspellingsshawnps2017-01-071-1/+1
| | | | | | | | | Change-Id: I429637ca91f7db4144f17621de851a548dc1ce76 Reviewed-on: https://go-review.googlesource.com/34923 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: deprecate HasPrefixJoe Tsai2016-12-163-1/+8
| | | | | | | | | | | | | | | | | | Use the new "Deprecated:" syntax for all instances of HasPrefix. This is a follow-up to http://golang.org/cl/28413 which only modified path_unix.go. In this CL, we avoid mentioning that strings.HasPrefix should be used since that function is still subtly wrong in security applications. See http://golang.org/cl/5712045 for more information. Fixes #18355 Change-Id: I0d0306152cd0b0ea5110774c2c78117515b9f5cd Reviewed-on: https://go-review.googlesource.com/34554 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path: document that filepath is recommended to manipulate filename pathsJaana Burcu Dogan2016-11-081-0/+2
| | | | | | | | Fixes #17690. Change-Id: Ifd300980aa4c11498ed7c083d08bcdd23f5b307a Reviewed-on: https://go-review.googlesource.com/32423 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: fix Abs on WindowsZev Goldstein2016-10-292-2/+9
| | | | | | | | | | | | | | | The filepath.Abs function in windows did not call Clean as the documentation claimed. This change not only fixes that behavior but also adjusts TestAbs to verify Abs calls Clean as documented. Fixes #17210 Change-Id: I20c5f5026042fd7bd9d929ff5b17c8b2653f8afe Reviewed-on: https://go-review.googlesource.com/32292 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: make TestToNorm robustHiroshi Ioka2016-10-251-10/+19
| | | | | | | | | | | | | | | | | | | The old code leaves garbages in a temporary directory because it cannot remove the current working directory on windows. The new code changes the directory before calling os.Remove. Furthermore, the old code assumes that ioutil.TempDir (os.TempDir) doesn't return a relative path nor an UNC path. If it isn't the case, the new code calls t.Fatal earlier for preventing ambiguous errors. Finally, the old code reassigns the variable which is used by the defer function. It could cause unexpected results, so avoid that. Change-Id: I5fc3902059ecaf18dc1341ecc4979d1206034cd7 Reviewed-on: https://go-review.googlesource.com/31790 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* test: delete bugs directoryJosh Bleecher Snyder2016-10-251-2/+2
| | | | | | | | | It appears to be a vestigial holding ground for bugs. But we have an issue tracker, and #1909 is there and open. Change-Id: I912ff222a24c51fab483be0c67dad534f5a84488 Reviewed-on: https://go-review.googlesource.com/31859 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: fix match of \\?\c:\* on WindowsRuss Cox2016-10-243-8/+20
| | | | | | | | | | | | \\?\c:\ is a "root directory" that is not subject to further matching, but the ? makes it look like a pattern, which was causing an infinite recursion. Make sure the code understands the ? is not a pattern. Fixes #15879. Change-Id: I3a4310bbc398bcae764b9f8859c875317345e757 Reviewed-on: https://go-review.googlesource.com/31460 Reviewed-by: Quentin Smith <quentin@golang.org>
* path/filepath: pass TestToNorm even if VolumeName(tmpdir) != VolumeName(pwd) ↵Hiroshi Ioka2016-10-231-5/+4
| | | | | | | | | | | on windows Fixes #17504 Change-Id: Ic83578cf2019e5d8778e4b324f04931eb802f603 Reviewed-on: https://go-review.googlesource.com/31544 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* path/filepath: simplify TestToNormHiroshi Ioka2016-10-161-3/+5
| | | | | | | | Change-Id: I8a176ed9c7f59ebdfd39c1e2b88905f977179982 Reviewed-on: https://go-review.googlesource.com/31119 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: add a test case for EvalSymlinks errorHiroshi Ioka2016-10-121-0/+22
| | | | | | | | | | EvalSymlinks returns error if given path or its target path don't exist. Add a test for future improvement. Change-Id: Ic9a4aa5eaee0fe7ac523d54d8eb3132a11b380b3 Reviewed-on: https://go-review.googlesource.com/27330 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
* path/filepath: remove unneeded doc statement for SplitListDmitri Shuralyov2016-10-121-1/+1
| | | | | | | | | | | | | | | | This is a followup to CL 24747, where the package doc phrase "Functions in this package replace occurrences of slash unless otherwise specified." was removed. The phrase was originally added in CL 7310 together with this explicit opt out statement for SplitList. Remove it since it's no longer neccessary. This helps consistency. Updates #16111. Updates #10122. Change-Id: Iba86de57c24100adecac9cb5892ce180126c0ea6 Reviewed-on: https://go-review.googlesource.com/25250 Reviewed-by: Russ Cox <rsc@golang.org>
* path/filepath: handle "C:." correctly in EvalSymlinks on WindowsHiroshi Ioka2016-09-052-2/+37
| | | | | | | | | | Fixes #16886 Change-Id: Idfacb0cf44d9994559c8e09032b4595887e76433 Reviewed-on: https://go-review.googlesource.com/28214 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: use new style deprecation messageJaana Burcu Dogan2016-09-021-0/+2
| | | | | | | | Change-Id: I242a8960583e333f372929aad4adb8efbe441cd4 Reviewed-on: https://go-review.googlesource.com/28413 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Jaana Burcu Dogan <jbd@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: handle ".." in normalizing a path on WindowsHiroshi Ioka2016-08-304-8/+159
| | | | | | | | | | | | | | | Current code assumes there are not ".." in the Clean(path). That's not true. Clean doesn't handle leading "..", so we need to stop normalization if we see "..". Fixes #16793 Change-Id: I0a7901bedac17f1210b134d593ebd9f5e8483775 Reviewed-on: https://go-review.googlesource.com/27410 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: don't return SkipDir at topIan Lance Taylor2016-08-252-5/+25
| | | | | | | | | | | | | | If the walker function called on a top-level file returns SkipDir, then (before this change) Walk would return SkipDir, which the documentation implies will not happen. Fixes #16280. Change-Id: I37d63bdcef7af4b56e342b624cf0d4b42e65c297 Reviewed-on: https://go-review.googlesource.com/24780 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: use testenv.MustHaveSymlink to simplify symlink testsHiroshi Ioka2016-08-233-45/+5
| | | | | | | | | | Cleanup test code for symbolic links. Change-Id: I25f561cd34dc4d120a4143f933619d233a6cffc5 Reviewed-on: https://go-review.googlesource.com/27573 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: fix typo in commentIan Lance Taylor2016-07-071-1/+1
| | | | | | | | Change-Id: I0c76e8deae49c1149647de421503c5175028b948 Reviewed-on: https://go-review.googlesource.com/24781 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: document Clean behavior for each functionIan Lance Taylor2016-07-061-5/+7
| | | | | | | | | | | | | | Document explicitly which functions Clean the result rather than documenting it in the package comment. Updates #10122. Fixes #16111. Change-Id: Ia589c7ee3936c9a6a758725ac7f143054d53e41e Reviewed-on: https://go-review.googlesource.com/24747 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: prevent infinite recursion on Windows on UNC inputJosh Bleecher Snyder2016-05-312-0/+11
| | | | | | | | | | | | | | This is a minimal fix to prevent this and other possible future infinite recursion. We can put in a proper fix for UNC in Go 1.8. Updates #15879 Change-Id: I3653cf5891bab8511adf66fa3c1a1d8912d1a293 Reviewed-on: https://go-review.googlesource.com/23572 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
* path/filepath: fix globbing of c:\*dir\... patternAlex Brainman2016-05-272-7/+196
| | | | | | | | | | | The problem was introduced by the recent filepath.Join change. Fixes #14949 Change-Id: I7ee52f210e12bbb1369e308e584ddb2c7766e095 Reviewed-on: https://go-review.googlesource.com/23240 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* all: use bytes.Equal, bytes.Contains and strings.Contains, againDominik Honnef2016-04-111-1/+1
| | | | | | | | | The previous cleanup was done with a buggy tool, missing some potential rewrites. Change-Id: I333467036e355f999a6a493e8de87e084f374e26 Reviewed-on: https://go-review.googlesource.com/21378 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: normalize output of EvalSymlinks on windowsHiroshi Ioka2016-04-053-39/+124
| | | | | | | | | | | | | | | | | Current implementation uses GetShortPathName and GetLongPathName to get a normalized path. That approach sometimes fails because user can disable short path name anytime. This CL provides an alternative approach suggested by MSDN. https://msdn.microsoft.com/en-us/library/windows/desktop/aa364989(v=vs.85).aspx Fixes #13980 Change-Id: Icf4afe4c9c4b507fc110c1483bf8db2c3f606b0a Reviewed-on: https://go-review.googlesource.com/20860 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path, path/filepath: add Join example with joined rooted pathRuss Cox2016-04-032-1/+22
| | | | | | | | | | | This makes clear that Go's path.Join and filepath.Join are different from the Python os.path.join (and perhaps others). Requested in private mail. Change-Id: Ie5dfad8a57f9baa5cca31246af1fd4dd5b1a64ee Reviewed-on: https://go-review.googlesource.com/20711 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* path/filepath: use fsutil with TestEvalSymlinksCanonicalNamesAlex Brainman2016-03-291-0/+105
| | | | | | | | | | | | | | | | TestEvalSymlinksCanonicalNames fails on system where 8dot3 name creation is disabled. Add new test that temporarily changes 8dot3 name creation file system setting and runs TestEvalSymlinksCanonicalNames under that setting. New test requires administrator access and modifies important file system setting, so don't run the test unless explicitly requested by specifying new test flag. Updates #13980 Change-Id: I598b5b956e6bd0ed556e79d350cb244808c89c0b Reviewed-on: https://go-review.googlesource.com/20863 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
* path: fix up bizarre testRob Pike2016-03-161-7/+1
| | | | | | | | | | | | | The Join test was doing something remarkable and unnecessary instead of just using ... on a slice. Maybe it was an editing relic. Fix it by deleting the monstrosity. Change-Id: I5b90c6d539d334a9c27e57d26dacd831721cfcfe Reviewed-on: https://go-review.googlesource.com/20727 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* Rewrite leftover references to plan9.bell-labs.com to 9p.io.Muhammed Uluyol2016-03-062-2/+2
| | | | | | Change-Id: Iadb4aa016a7b361d01827787dbc59164d5d147f2 Reviewed-on: https://go-review.googlesource.com/20291 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: single space after period.Brad Fitzpatrick2016-03-023-4/+4
| | | | | | | | | | | | | | | | | | | | The tree's pretty inconsistent about single space vs double space after a period in documentation. Make it consistently a single space, per earlier decisions. This means contributors won't be confused by misleading precedence. This CL doesn't use go/doc to parse. It only addresses // comments. It was generated with: $ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])') $ go test go/doc -update Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7 Reviewed-on: https://go-review.googlesource.com/20022 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Dave Day <djd@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: fix typos and spellingMartin Möhrmann2016-02-241-1/+1
| | | | | | | | Change-Id: Icd06d99c42b8299fd931c7da821e1f418684d913 Reviewed-on: https://go-review.googlesource.com/19829 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: fix typosShawn Smith2016-02-231-1/+1
| | | | | | | | Change-Id: I6035941df8b0de6aeaf6c05df7257bcf6e9191fe Reviewed-on: https://go-review.googlesource.com/19320 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* all: replace strings.Index with strings.Contains where possibleNathan VanBenschoten2016-02-193-4/+4
| | | | | | | Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a Reviewed-on: https://go-review.googlesource.com/18120 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
* path/filepath: include test number in TestIssue13582 outputAlex Brainman2015-12-151-2/+2
| | | | | | | | | | | Otherwise it's hard to tell the difference between link1 and link2 or other tests. Change-Id: I36c153cccb10959535595938dfbc49db930b9fac Reviewed-on: https://go-review.googlesource.com/17851 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: keep walking if EvalSymlinks returns symlinkAlex Brainman2015-12-143-11/+90
| | | | | | | | | Fixes #13582 Change-Id: I220f3c7b9511b3c080874f5c42f2a431fdddcbb7 Reviewed-on: https://go-review.googlesource.com/17794 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* path/filepath: remove code working around Join bugAlex Brainman2015-12-091-2/+1
| | | | | | | | | | | | | EvalSymlinks code assumes that Join has a bug (see issue #11551 for details). But issue #11551 has been fixed. Remove the workaround so it does not confuses us when we read code next time. Change-Id: I06bea20189f01f9922237c05516847353d8e4736 Reviewed-on: https://go-review.googlesource.com/17620 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: handle c: as first parameter in Join properlyAlex Brainman2015-12-062-1/+11
| | | | | | | | | | | | This is CL 11882 brought back to life. Fixes #11551 Change-Id: I29810183957745442d1e9937f56a66fc9c6cc82a Reviewed-on: https://go-review.googlesource.com/17470 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path: fix typoShenghou Ma2015-11-281-1/+1
| | | | | | | | Fixes #13419. Change-Id: I530d0b714ea0743c72eacd07b390c3f8cc556e21 Reviewed-on: https://go-review.googlesource.com/17239 Reviewed-by: Robert Griesemer <gri@golang.org>
* path/filepath: in Rel use case-insensitive comparison on WindowsMohit Agarwal2015-11-172-1/+3
| | | | | | | | | | | | | | Compare basepath and targetpath using strings.EqualFold. The absence of this on Windows causes an unterminating condition in `for` statement later in the function. Fixes #13258 Change-Id: Ib5a0caba864ee425dc75ece47b9cf6fb626f47f1 Reviewed-on: https://go-review.googlesource.com/16857 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* path/filepath: include the original paths in error messagesMohit Agarwal2015-11-172-3/+3
| | | | | | | | | | | | | | | | | On Windows, Rel emits error messages of the form `Rel: can't make \windows relative to \windows`. Rather than emitting paths after stripping volume names, emit the original paths so as to make those of the form `Rel: can't make d:\windows relative to c:\windows`. Fixed a test that expected the error message to emit clean path instead of the original. Fixes #13259 Change-Id: I3a9bd5b137205f22794ec8046b4e917ee48cf750 Reviewed-on: https://go-review.googlesource.com/16858 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* path/filepath: in Rel use case-insensitive comparison on WindowsYasuhiro Matsumoto2015-11-125-2/+15
| | | | | | | | | | Fixes #10802 Compare Volume name and each path elements using strings.EqualFold. Change-Id: Ibdefdb801d0326e53755bc9cc8c10eed998094e5 Reviewed-on: https://go-review.googlesource.com/16795 Reviewed-by: Russ Cox <rsc@golang.org>
* path/filepath: fix EvalSymlinks(".") on windowsAlex Brainman2015-11-013-50/+166
| | | | | | | | | | | | | Also new tests added. So, perhaps, this CL corrects even more broken EvalSymlinks behaviour. Fixes #12451 Change-Id: I81b9d92bab74bcb8eca6db6633546982fe5cec87 Reviewed-on: https://go-review.googlesource.com/16192 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* path/filepath: test EvalSymlinks returns canonical path on windowsAlex Brainman2015-10-222-26/+68
| | | | | | | | | | | | | | | | | | | When you create C:\A.TXT file on windows, you can open it as c:\a.txt. EvalSymlinks("c:\a.txt") returns C:\A.TXT. This is all EvalSymlinks did in the past, but recently symlinks functionality been implemented on some Windows version (where symlinks are supported). So now EvalSymlinks handles both: searching for file canonical name and resolving symlinks. Unfortunately TestEvalSymlinks has not been adjusted properly. The test tests either canonical paths or symlinks, but not both. This CL separates canonical paths tests into new TestEvalSymlinksCanonicalNames, so all functionality is covered. Tests are simplified somewhat too. Also remove EvalSymlinksAbsWindowsTests - it seems not used anywhere. Change-Id: Id12e9f1441c1e30f15c523b250469978e4511a84 Reviewed-on: https://go-review.googlesource.com/14412 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* path/filepath: disable symlink tests on android.Hyang-Ah Hana Kim2015-10-202-2/+2
| | | | | | | | | | Same reason as https://go-review.googlesource.com/#/c/16115/ For golang/go#10807 Change-Id: Id0c404e9feb963f39a111fc317c9787692516ae1 Reviewed-on: https://go-review.googlesource.com/16116 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>