summaryrefslogtreecommitdiff
path: root/src/libexecline/el_vardupl.c
blob: 9efd58678667c9c94d0ce52b0694c74074116a71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* ISC license. */

#include <sys/types.h>
#include <skalibs/bytestr.h>
#include <execline/execline.h>

int el_vardupl (char const *key, char const *s, size_t len)
{
  size_t i = 0 ;
  for (; i < len ; i += str_len(s + i) + 1)
    if (!str_diff(key, s + i)) return 1 ;
  return 0 ;
}