1 /*-------------------------------------------------------------------------
4 * string handling helpers
7 * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
14 *-------------------------------------------------------------------------
21 #include "postgres_fe.h"
24 #include "common/string.h"
28 * Returns whether the string `str' has the postfix `end'.
31 pg_str_endswith(const char *str, const char *end)
33 size_t slen = strlen(str);
34 size_t elen = strlen(end);
36 /* can't be a postfix if longer */
40 /* compare the end of the strings */
42 return strcmp(str, end) == 0;