LCOV - code coverage report
Current view: top level - src/common - string.c (source / functions) Hit Total Coverage
Test: PostgreSQL Lines: 0 7 0.0 %
Date: 2017-09-29 13:40:31 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * string.c
       4             :  *      string handling helpers
       5             :  *
       6             :  *
       7             :  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
       8             :  * Portions Copyright (c) 1994, Regents of the University of California
       9             :  *
      10             :  *
      11             :  * IDENTIFICATION
      12             :  *    src/common/string.c
      13             :  *
      14             :  *-------------------------------------------------------------------------
      15             :  */
      16             : 
      17             : 
      18             : #ifndef FRONTEND
      19             : #include "postgres.h"
      20             : #else
      21             : #include "postgres_fe.h"
      22             : #endif
      23             : 
      24             : #include "common/string.h"
      25             : 
      26             : 
      27             : /*
      28             :  * Returns whether the string `str' has the postfix `end'.
      29             :  */
      30             : bool
      31           0 : pg_str_endswith(const char *str, const char *end)
      32             : {
      33           0 :     size_t      slen = strlen(str);
      34           0 :     size_t      elen = strlen(end);
      35             : 
      36             :     /* can't be a postfix if longer */
      37           0 :     if (elen > slen)
      38           0 :         return false;
      39             : 
      40             :     /* compare the end of the strings */
      41           0 :     str += slen - elen;
      42           0 :     return strcmp(str, end) == 0;
      43             : }

Generated by: LCOV version 1.11