]> Cypherpunks repositories - gostls13.git/commit
path/filepath: add IsLocal
authorDamien Neil <dneil@google.com>
Thu, 10 Nov 2022 01:49:44 +0000 (17:49 -0800)
committerDamien Neil <dneil@google.com>
Wed, 16 Nov 2022 23:17:58 +0000 (23:17 +0000)
commit6d0bf438e302afcb0db5422ea2da59d1995e08c1
treeb931b814d4a959903ea32c37ec69d92fcb0ca7c5
parentfd59c6cf8cb600f2911864948303016581abf016
path/filepath: add IsLocal

IsLocal reports whether a path lexically refers to a location
contained within the directory in which it is evaluated.
It identifies paths that are absolute, escape a directory
with ".." elements, and (on Windows) paths that reference
reserved device names.

For #56219.

Change-Id: I35edfa3ce77b40b8e66f1fc8e0ff73cfd06f2313
Reviewed-on: https://go-review.googlesource.com/c/go/+/449239
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
api/next/56219.txt [new file with mode: 0644]
doc/go1.20.html
src/path/filepath/path.go
src/path/filepath/path_plan9.go
src/path/filepath/path_test.go
src/path/filepath/path_unix.go
src/path/filepath/path_windows.go