From: Christoph Berg Date: Thu, 6 Jun 2024 14:21:02 +0000 (+0200) Subject: Allow finding the toast table in current directory X-Git-Tag: REL_17_0~6 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e7d52d52e1956298f223361091c2bcbd108f3086;p=pg_filedump.git Allow finding the toast table in current directory get_parent_directory() returns "" when there is no directory part; replace that by ".". --- diff --git a/decode.c b/decode.c index 1220080..2bbacb4 100644 --- a/decode.c +++ b/decode.c @@ -1371,7 +1371,8 @@ ReadStringFromToast(const char *buffer, /* Open TOAST relation file */ toast_relation_path = strdup(fileName); get_parent_directory(toast_relation_path); - sprintf(toast_relation_filename, "%s/%d", toast_relation_path, + sprintf(toast_relation_filename, "%s/%d", + *toast_relation_path ? toast_relation_path : ".", toast_ptr.va_toastrelid); printf(" Read TOAST relation %s\n", toast_relation_filename); toast_rel_fp = fopen(toast_relation_filename, "rb");