about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-05-06 17:58:00 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-05-06 17:58:00 +0200
commit1ef700f918f706da2098460ead880b2538aaf262 (patch)
treed9d315aa6735e569561e067a0c0b177b3fe3b208
parent929faae926ea947d0a94fcc6ed99851f5d4896db (diff)
downloadprofani-tty-1ef700f918f706da2098460ead880b2538aaf262.tar.gz
Reduce scope of dir variable
-rw-r--r--src/command/cmd_ac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index d439f871..14af0552 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -1589,12 +1589,13 @@ cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean
     free(inpcp);
     free(inpcp2);
 
-    struct dirent* dir;
     GArray* files = g_array_new(TRUE, FALSE, sizeof(char*));
     g_array_set_clear_func(files, (GDestroyNotify)_filepath_item_free);
 
     DIR* d = opendir(directory);
     if (d) {
+        struct dirent* dir;
+
         while ((dir = readdir(d)) != NULL) {
             if (strcmp(dir->d_name, ".") == 0) {
                 continue;