"log"
"os"
"path"
+ "runtime"
"strconv"
"strings"
)
// is this path a local name? begins with ./ or ../ or /
func islocalname(name string) bool {
return strings.HasPrefix(name, "/") ||
- Ctxt.Windows != 0 && len(name) >= 3 && isDriveLetter(name[0]) && name[1] == ':' && name[2] == '/' ||
+ runtime.GOOS == "windows" && len(name) >= 3 && isDriveLetter(name[0]) && name[1] == ':' && name[2] == '/' ||
strings.HasPrefix(name, "./") || name == "." ||
strings.HasPrefix(name, "../") || name == ".."
}
if i := strings.LastIndex(p, "/"); i >= 0 {
p = p[i+1:]
}
- if Ctxt.Windows != 0 {
+ if runtime.GOOS == "windows" {
if i := strings.LastIndex(p, `\`); i >= 0 {
p = p[i+1:]
}
"log"
"os"
"path/filepath"
- "runtime"
"strconv"
)
ctxt.Version = HistVersion
ctxt.Goroot = Getgoroot()
ctxt.Goroot_final = os.Getenv("GOROOT_FINAL")
- if runtime.GOOS == "windows" {
- // TODO(rsc): Remove ctxt.Windows and let callers use runtime.GOOS.
- ctxt.Windows = 1
- }
var buf string
buf, _ = os.Getwd()