Merge pull request #11090 from amarshall/fix-stackoverflow-build

Fix stackoverflow during doc generation
This commit is contained in:
Robert Hensing 2024-07-12 17:51:29 +02:00 committed by GitHub
commit 6c5d2a1506
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,9 +116,12 @@ let
storeInfo = commandInfo.stores;
inherit inlineHTML;
};
hasInfix = infix: content:
builtins.stringLength content != builtins.stringLength (replaceStrings [ infix ] [ "" ] content);
in
optionalString (details ? doc) (
if match ".*@store-types@.*" details.doc != null
# An alternate implementation with builtins.match stack overflowed on some systems.
if hasInfix "@store-types@" details.doc
then help-stores
else details.doc
);