File: strsep.c

package info (click to toggle)
zlibc 0.9k-4.3
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 624 kB
  • ctags: 461
  • sloc: sh: 3,195; ansic: 3,077; csh: 128; makefile: 60; sed: 4
file content (36 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * strsep.c
 *
 * Copyright (C) 1993 Alain Knaff
 */
#include <stdio.h>
#include <string.h>
#include <config.h>
#ifndef HAVE_STRSEP
/*
 * SunOs lacks strsep
 */

char *strsep(char **stringp,__const char *delim)
{
  char *newpos, *oldpos;

  oldpos = *stringp;

  if ( oldpos == NULL )
    return NULL;

  newpos = strpbrk( oldpos, delim);

  if ( newpos ){
    *newpos='\0';
    newpos++;
  }

  *stringp = newpos;
  return oldpos;
}



#endif