docs: sphinx-build-wrapper: don't allow "/" on file names

When handling "DOC:" sections, slash characters may be there.
Prevent using it at the file names, as this is used for directory
separator.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <c1a83a50b0659a5bcf68ef14f9457cc188e91e3a.1772810752.git.mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2026-03-06 16:45:40 +01:00 committed by Jonathan Corbet
parent 5828d35647
commit 0e4c8adad4

View File

@ -625,7 +625,9 @@ class SphinxBuilder:
# Use shlex here, as it handles well parameters with commas
args = shlex.split(line)
fname = f"{output_dir}/{args[3]}.{args[2]}"
fname = f"{args[3]}.{args[2]}"
fname = fname.replace("/", " ")
fname = f"{output_dir}/{fname}"
if self.verbose:
print(f"Creating {fname}")