PostgreSQL Source Code: src/port/strsep.c File Reference (original) (raw)

#include "[c.h](c%5F8h%5Fsource.html)"

Go to the source code of this file.

Functions
char * strsep (char **stringp, const char *delim)
char * strsep ( char ** stringp,
const char * delim
)

Definition at line 49 of file strsep.c.

50{

51 char *s;

52 const char *spanp;

53 int c,

54 sc;

55 char *tok;

56

57 if ((s = *stringp) == NULL)

58 return (NULL);

59 for (tok = s;;)

60 {

61 c = *s++;

62 spanp = delim;

63 do

64 {

65 if ((sc = *spanp++) == c)

66 {

67 if (c == 0)

68 s = NULL;

69 else

70 s[-1] = 0;

71 *stringp = s;

72 return (tok);

73 }

74 } while (sc != 0);

75 }

76

77}

Referenced by parse_scram_secret(), pg_logging_init(), and split_to_stringlist().