authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2021-05-23 16:44:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-05-24 13:24:21-04:00
log6426519e32bc5d0470d6a2775050b9e303823a62
treed32b10de91ef6599ca53f1f8f3962d12eb0a94f1
parent75cd37b8f7c88e87b889a30ce741a3c257002732

zig fmt: Remove workaround for . and .. path handling on Windows

Added in #4655/#5187, obsoleted by #7664

1 files changed, 1 insertions(+), 7 deletions(-)

src/main.zig+1-7
...@@ -2986,13 +2986,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {...@@ -2986,13 +2986,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
2986 defer fmt.out_buffer.deinit();2986 defer fmt.out_buffer.deinit();
29872987
2988 for (input_files.items) |file_path| {2988 for (input_files.items) |file_path| {
2989 // Get the real path here to avoid Windows failing on relative file paths with . or .. in them.2989 try fmtPath(&fmt, file_path, check_flag, fs.cwd(), file_path);
2990 const real_path = fs.realpathAlloc(gpa, file_path) catch |err| {
2991 fatal("unable to open '{s}': {s}", .{ file_path, @errorName(err) });
2992 };
2993 defer gpa.free(real_path);
2994
2995 try fmtPath(&fmt, file_path, check_flag, fs.cwd(), real_path);
2996 }2990 }
2997 if (fmt.any_error) {2991 if (fmt.any_error) {
2998 process.exit(1);2992 process.exit(1);