#include "filemap.h"
#include "pg_rewind.h"
+#include "common/string.h"
#include "catalog/pg_tablespace.h"
#include "storage/fd.h"
return map;
}
-static bool
-endswith(const char *haystack, const char *needle)
-{
- int needlelen = strlen(needle);
- int haystacklen = strlen(haystack);
-
- if (haystacklen < needlelen)
- return false;
-
- return strcmp(&haystack[haystacklen - needlelen], needle) == 0;
-}
-
/*
* Callback for processing remote file list.
*/
* An exception: PG_VERSIONs should be identical, but avoid
* overwriting it for paranoia.
*/
- if (endswith(path, "PG_VERSION"))
+ if (pg_str_endswith(path, "PG_VERSION"))
{
action = FILE_ACTION_NONE;
oldsize = statbuf.st_size;