Laytan Laats 10 months ago
parent
commit
8b5492dd4d
1 changed files with 15 additions and 15 deletions
  1. 15 15
      core/sys/posix/dirent.odin

+ 15 - 15
core/sys/posix/dirent.odin

@@ -30,12 +30,12 @@ foreign lib {
 			panic(string(posix.strerror(posix.errno())))
 		}
 		defer posix.free(list)
-	
+
 		entries := list[:ret]
-	 	for entry in entries {
-	 		log.info(entry)
-	 		posix.free(entry)
-	 	}
+		for entry in entries {
+			log.info(entry)
+			posix.free(entry)
+		}
 
 	[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html ]]
 	*/
@@ -90,16 +90,16 @@ foreign lib {
 	Returns nil when the end is reached or an error occurred (which sets errno).
 
 	Example:
-	 	posix.set_errno(.NONE)
-	 	entry := posix.readdir(dirp)
-	 	if entry == nil {
-	 		if errno := posix.errno(); errno != .NONE {
-	 			panic(string(posix.strerror(errno)))
-	 		} else {
-	 			fmt.println("end of directory stream")
-	 		}
-	 	} else {
-	 		fmt.println(entry)
+		posix.set_errno(.NONE)
+		entry := posix.readdir(dirp)
+		if entry == nil {
+			if errno := posix.errno(); errno != .NONE {
+				panic(string(posix.strerror(errno)))
+			} else {
+				fmt.println("end of directory stream")
+			}
+		} else {
+			fmt.println(entry)
 		}
 
 	[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html ]]