From 9c2f143ca3ce0bfe03a391e6ed1dc795e868756a Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Fri, 29 May 2026 21:10:37 -0400
Subject: [PATCH] wikiheaders: Fix manpages for APIs that return a pointer to a
const object.
Previously something like SDL_GetCurrentDisplayMode() would have this output:
RETURN VALUE
*) Returns a pointer to the desktop display mode or NULL on failure; call SDL_GetError() for more information.
Now it doesn't have the junk at the start of the text:
RETURN VALUE
Returns a pointer to the desktop display mode or NULL on failure; call SDL_GetError() for more information.
---
build-scripts/wikiheaders.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index 51e7d7d23676f..e7074c959a061 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -3060,7 +3060,7 @@ sub generate_envvar_wiki_page {
if (defined $returns) {
# Check for md link in return type: ([SDL_Renderer](SDL_Renderer) *)
# This would've prevented the next regex from working properly (it'd leave " *)")
- $returns =~ s/\A\(\[.*?\]\((.*?)\)/\($1/ms;
+ $returns =~ s/\A\((const|)\s*\[.*?\]\((.*?)\)/\($2/ms;
# Chop datatype in parentheses off the front.
$returns =~ s/\A\(.*?\) //;