Implement INCLUDE_ONCE directive (#1481)

Identify files by (device, inode), not by path, so that symlinks,
relative paths, case-insensitive paths, or other edge cases
do not result in double includes.
This commit is contained in:
sukus
2024-09-08 06:02:02 +02:00
committed by GitHub
parent 11f0e88b30
commit 5f07095f6d
8 changed files with 62 additions and 8 deletions

View File

@@ -2158,7 +2158,17 @@ calls infinitely (or until you run out of memory, whichever comes first).
INCLUDE "irq.inc"
.Ed
.Pp
You may also implicitly
You may also ensure a file only gets included once by using
.Ic INCLUDE_ONCE
instead of
.Ic INCLUDE .
This will skip including a file if it has already been included before (with
.Ic INCLUDE ,
.Ic INCLUDE_ONCE ,
or
.Fl P ) .
.Pp
You can implicitly
.Ic INCLUDE
a file before the source file with the
.Fl P