composetable: Reduce the scope of a variable
authorMatthias Clasen <mclasen@redhat.com>
Thu, 29 Jul 2021 12:22:52 +0000 (08:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 29 Jul 2021 12:22:52 +0000 (08:22 -0400)
'prefix' is not a good name for a file-scope variable,
move it into the sole function using it.

gtk/gtkcomposetable.c

index c95b153e6fb0a1134d978efe683f48e65393054d..40dd8b6e41fe05b5e8a635b5152b3a301821f11e 100644 (file)
@@ -1069,22 +1069,22 @@ gtk_compose_table_parse (const char *compose_file,
   return compose_table;
 }
 
-static const char *prefix =
-  "# GTK has rewritten this file to add the line:\n"
-  "\n"
-  "include \"%L\"\n"
-  "\n"
-  "# This is necessary to add your own Compose sequences\n"
-  "# in addition to the builtin sequences of GTK. If this\n"
-  "# is not what you want, just remove that line.\n"
-  "#\n"
-  "# A backup of the previous file contents has been made.\n"
-  "\n"
-  "\n";
-
 static gboolean
 rewrite_compose_file (const char *compose_file)
 {
+  static const char *prefix =
+    "# GTK has rewritten this file to add the line:\n"
+    "\n"
+    "include \"%L\"\n"
+    "\n"
+    "# This is necessary to add your own Compose sequences\n"
+    "# in addition to the builtin sequences of GTK. If this\n"
+    "# is not what you want, just remove that line.\n"
+    "#\n"
+    "# A backup of the previous file contents has been made.\n"
+    "\n"
+    "\n";
+
   char *path = NULL;
   char *content = NULL;
   gsize content_len;