INNER CODE UNIT · Python
is_absolute_path_token
wolfSSL/wolfBoot · tools/sbom/sbom-driver.py:53
def is_absolute_path_token(token):
"""Return True when a macro token looks like an absolute host path."""
return bool(
_ABS_PATH_POSIX.match(token) or
_ABS_PATH_WINDOWS_DRIVE.match(token) or
_ABS_PATH_WINDOWS_UNC.match(token)
)
def scrub_defines(text):
"""Redact absolute-path tokens from a flat #define header text.
A macro value that is (or contains) an absolute path would otherwise make
the SBOM machine-specific and leak the local file system. The macro name is
kept, so the configuration record stays complete.
"""
out = []
for line in text.splitlines():