diff --git a/compat.c b/compat.c
index a689a146b10b6c48a429adfe85705292267b29b5..71558a58e891881bad15677b0e40315f4f78cf62 100644
--- a/compat.c
+++ b/compat.c
@@ -235,7 +235,7 @@ void setusershell() {
 
 static char **initshells() {
 	/* don't touch this list. */
-	const char *okshells[] = { "/bin/sh", "/bin/csh", NULL };
+	static const char *okshells[] = { "/bin/sh", "/bin/csh", NULL };
 	register char **sp, *cp;
 	register FILE *fp;
 	struct stat statb;