Skip to content

ext/dba/inifile: Do some refactoring #15316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Nits
  • Loading branch information
Girgias committed Aug 11, 2024
commit 129560462e2dbc1fc7b3c152508c51a0164845f6
7 changes: 3 additions & 4 deletions ext/dba/libinifile/inifile.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons

/* 5 */
if (!value || (key->name && strlen(key->name))) {
bool has_succeeded = inifile_truncate(dba, is_append ? pos_grp_next : pos_grp_start);
if (!has_succeeded) {
/* Warning is already emited by inifile_truncate() on failure */
if (!inifile_truncate(dba, is_append ? pos_grp_next : pos_grp_start)) {
/* Warning is already emitted by inifile_truncate() on failure */
goto end;
}
}
Expand Down Expand Up @@ -511,7 +510,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
}
}

end:
end:
if (ini_tmp) {
php_stream_close(ini_tmp->fp);
inifile_free(ini_tmp, /* persistent */ false);
Expand Down
Loading