Skip to content

Commit

Permalink
Make rz_file_path_join prepared for an empty string in the first arg
Browse files Browse the repository at this point in the history
  • Loading branch information
arrowd authored and XVilka committed Aug 3, 2023
1 parent f3667b0 commit c6dc4ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions librz/util/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,9 @@ RZ_API RzList /*<char *>*/ *rz_file_globsearch(const char *_globbed_path, int ma
RZ_API RZ_OWN char *rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2) {
rz_return_val_if_fail(s1, NULL);

if (s1[0] == 0) {
return strdup(s2);
}
if (!s2) {
return strdup(s1);
}
Expand Down

0 comments on commit c6dc4ee

Please sign in to comment.