Adding upstream version 1.65.7.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5189956325
commit
32b8eb3fd7
4153 changed files with 2487292 additions and 0 deletions
18
testdata/nsz.repo.hu/libc-test/src/common/path.c
vendored
Normal file
18
testdata/nsz.repo.hu/libc-test/src/common/path.c
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "test.h"
|
||||
|
||||
/* relative path to p */
|
||||
char *t_pathrel(char *buf, size_t n, char *argv0, char *p)
|
||||
{
|
||||
char *s = strrchr(argv0, '/');
|
||||
int k;
|
||||
|
||||
if (s)
|
||||
k = snprintf(buf, n, "%.*s/%s", (int)(s-argv0), argv0, p);
|
||||
else
|
||||
k = snprintf(buf, n, "./%s", p);
|
||||
if ((size_t)k >= n)
|
||||
return 0;
|
||||
return buf;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue