Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/filenamecat-lgpl.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | char * | - | ||||||||||||
6 | mfile_name_concat (char const *dir, char const *base, char **base_in_result) | - | ||||||||||||
7 | { | - | ||||||||||||
8 | char const *dirbase = last_component (dir); | - | ||||||||||||
9 | size_t dirbaselen = base_len (dirbase); | - | ||||||||||||
10 | size_t dirlen = dirbase - dir + dirbaselen; | - | ||||||||||||
11 | size_t baselen = strlen (base); | - | ||||||||||||
12 | char sep = '\0'; | - | ||||||||||||
13 | if (dirbaselen
| 0-132609 | ||||||||||||
14 | { | - | ||||||||||||
15 | - | |||||||||||||
16 | if (! ((dir[dirlen - 1]) == '/')
| 0-132609 | ||||||||||||
17 | sep = '/'; executed 132609 times by 7 tests: sep = '/'; Executed by:
| 132609 | ||||||||||||
18 | } executed 132609 times by 7 tests: end of block Executed by:
| 132609 | ||||||||||||
19 | else if (((*
| 0 | ||||||||||||
20 | { | - | ||||||||||||
21 | - | |||||||||||||
22 | - | |||||||||||||
23 | - | |||||||||||||
24 | - | |||||||||||||
25 | - | |||||||||||||
26 | sep = '.'; | - | ||||||||||||
27 | } never executed: end of block | 0 | ||||||||||||
28 | - | |||||||||||||
29 | char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1); | - | ||||||||||||
30 | char *p; | - | ||||||||||||
31 | - | |||||||||||||
32 | if (p_concat ==
| 0-132609 | ||||||||||||
33 | ((void *)0)
| 0-132609 | ||||||||||||
34 | ) | - | ||||||||||||
35 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||
36 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||
37 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||
38 | - | |||||||||||||
39 | p = mempcpy (p_concat, dir, dirlen); | - | ||||||||||||
40 | *p = sep; | - | ||||||||||||
41 | p += sep != '\0'; | - | ||||||||||||
42 | - | |||||||||||||
43 | if (base_in_result
| 28-132581 | ||||||||||||
44 | * executed 28 times by 2 tests: base_in_result = p;*base_in_result = p; Executed by:
executed 28 times by 2 tests: *base_in_result = p; Executed by:
| 28 | ||||||||||||
45 | - | |||||||||||||
46 | p = mempcpy (p, base, baselen); | - | ||||||||||||
47 | *p = '\0'; | - | ||||||||||||
48 | - | |||||||||||||
49 | return executed 132609 times by 7 tests: p_concat;return p_concat; Executed by:
executed 132609 times by 7 tests: return p_concat; Executed by:
| 132609 | ||||||||||||
50 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |