Skip to content

Commit 4ad9f19

Browse files
committed
Fix CS
1 parent 01a6840 commit 4ad9f19

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

TSRM/tsrm_virtual_cwd.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,11 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
619619
*bucket = (*bucket)->next;
620620

621621
/* if the pointers match then only subtract the length of the path */
622-
if(r->path == r->realpath)
623-
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
624-
else
625-
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
622+
if(r->path == r->realpath) {
623+
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
624+
} else {
625+
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
626+
}
626627

627628
free(r);
628629
return;
@@ -700,10 +701,11 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
700701
*bucket = (*bucket)->next;
701702

702703
/* if the pointers match then only subtract the length of the path */
703-
if(r->path == r->realpath)
704-
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
705-
else
706-
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
704+
if(r->path == r->realpath) {
705+
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
706+
} else {
707+
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
708+
}
707709

708710
free(r);
709711
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&

0 commit comments

Comments
 (0)