1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Reduce scope of dir variable

This commit is contained in:
Michael Vetter 2021-05-06 17:58:00 +02:00
parent 929faae926
commit 1ef700f918

View File

@ -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;