Skip to content

Commit 53cf1d0

Browse files
committed
Add a note regarding Nob_Walk_Entry.path
1 parent 1393b2a commit 53cf1d0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

nob.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,15 @@ typedef enum {
272272
} Nob_Walk_Action;
273273

274274
typedef struct {
275-
// The path to the visited file
275+
// The path to the visited file. The lifetime of the path string is very short.
276+
// As soon as the execution exits the Nob_Walk_Func it's dead. Dup it somewhere
277+
// if you want to preserve it for longer periods of time.
276278
const char *path;
277-
// The type of the visited file
279+
// The type of the visited file.
278280
Nob_File_Type type;
279-
// How nested we currently are in the directory tree
281+
// How nested we currently are in the directory tree.
280282
size_t level;
281-
// User data supplied in Nob_Walk_Dir_Opt.data
283+
// User data supplied in Nob_Walk_Dir_Opt.data.
282284
void *data;
283285
// The action nob_walk_dir_opt() must perform after the Nob_Walk_Func has returned.
284286
// Default is NOB_WALK_CONT.

0 commit comments

Comments
 (0)