Hi,
I found in guc-file.l we can omit the else branch in AbsoluteConfigLocation().
diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l
index c98e220295..9d4b3d7236 100644
--- a/src/backend/utils/misc/guc-file.l
+++ b/src/backend/utils/misc/guc-file.l
@@ -522,23 +522,21 @@ AbsoluteConfigLocation(const char *location, const char *calling_file)
if (is_absolute_path(location))
return pstrdup(location);
+
+ if (calling_file != NULL)
+ {
+ strlcpy(abs_path, calling_file, sizeof(abs_path));
+ get_parent_directory(abs_path);
+ join_path_components(abs_path, abs_path, location);
+ canonicalize_path(abs_path);
+ }
else
{
- if (calling_file != NULL)
- {
- strlcpy(abs_path, calling_file, sizeof(abs_path));
- get_parent_directory(abs_path);
- join_path_components(abs_path, abs_path, location);
- canonicalize_path(abs_path);
- }
- else
- {
- AssertState(DataDir);
- join_path_components(abs_path, DataDir, location);
- canonicalize_path(abs_path);
- }
- return pstrdup(abs_path);
+ AssertState(DataDir);
+ join_path_components(abs_path, DataDir, location);
+ canonicalize_path(abs_path);
}
+ return pstrdup(abs_path);
}
--
Best regards
Japin Li