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

#include <skalibs/bytestr.h>
#include <skalibs/env.h>
#include <skalibs/djbunix.h>

void pathexec_r_name (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen)
{
  size_t n = envlen + 1 + byte_count(modifs, modiflen, '\0') ;
  char const *v[n] ;
  if (env_merge(v, n, envp, envlen, modifs, modiflen))
    pathexec_run(file, argv, v) ;
}