Skip to content

Commit

Permalink
(local_opendir): narrow variable scopes joining declaration and assig…
Browse files Browse the repository at this point in the history
…nment

Signed-off-by: Yury V. Zaytsev <[email protected]>
  • Loading branch information
zyv authored and aborodin committed Feb 3, 2025
1 parent f626558 commit 8cad334
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/vfs/local/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ local_open (const vfs_path_t *vpath, int flags, mode_t mode)
static void *
local_opendir (const vfs_path_t *vpath)
{
DIR **local_info;
DIR *dir = NULL;
const char *path;

path = vfs_path_get_last_path_str (vpath);
const char *path = vfs_path_get_last_path_str (vpath);

/* According to POSIX, `opendir` and `readdir` can't return EINTR (unlike `closedir`).
*
Expand Down Expand Up @@ -117,7 +115,7 @@ local_opendir (const vfs_path_t *vpath)
rewinddir (dir);
}

local_info = (DIR **) g_new (DIR *, 1);
DIR **local_info = (DIR **) g_new (DIR *, 1);
*local_info = dir;

return local_info;
Expand Down

0 comments on commit 8cad334

Please sign in to comment.