fix os error

This commit is contained in:
Daniel Gavin
2021-04-14 02:20:05 +02:00
parent cb4b7efd3e
commit c46317c00b
3 changed files with 13 additions and 4 deletions
+2 -1
View File
@@ -201,7 +201,8 @@ align_comments :: proc(p: ^Printer) {
if .Line_Comment in line.types {
if current_info.end + 1 != line_index || current_info.depth != line.depth {
if current_info.end + 1 != line_index || current_info.depth != line.depth ||
(current_info.begin == current_info.end && current_info.length == 0) {
if (current_info.begin != 0 && current_info.end != 0) || current_info.length > 0 {
append(&comment_infos, current_info);
+2 -2
View File
@@ -273,7 +273,7 @@ is_file :: proc(path: string) -> bool {
attribs := win32.GetFileAttributesW(wpath);
if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES {
return attribs & win32.FILE_ATTRIBUTE_DIRECTORY == win32.FILE_ATTRIBUTE_DIRECTORY;
return attribs & win32.FILE_ATTRIBUTE_DIRECTORY == 0;
}
return false;
}
@@ -283,7 +283,7 @@ is_dir :: proc(path: string) -> bool {
attribs := win32.GetFileAttributesW(wpath);
if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES {
return attribs & win32.FILE_ATTRIBUTE_DIRECTORY != win32.FILE_ATTRIBUTE_DIRECTORY;
return attribs & win32.FILE_ATTRIBUTE_DIRECTORY != 0;
}
return false;
}