Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/basename-lgpl.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | - | |||||||||||||||||||
6 | - | |||||||||||||||||||
7 | - | |||||||||||||||||||
8 | - | |||||||||||||||||||
9 | char * | - | ||||||||||||||||||
10 | last_component (char const *name) | - | ||||||||||||||||||
11 | { | - | ||||||||||||||||||
12 | char const *base = name + 0; | - | ||||||||||||||||||
13 | char const *p; | - | ||||||||||||||||||
14 | - | |||||||||||||||||||
15 | _Bool | - | ||||||||||||||||||
16 | saw_slash = | - | ||||||||||||||||||
17 | 0 | - | ||||||||||||||||||
18 | ; | - | ||||||||||||||||||
19 | - | |||||||||||||||||||
20 | while (((*
| 12632-147069 | ||||||||||||||||||
21 | base++; executed 12632 times by 12 tests: base++; Executed by:
| 12632 | ||||||||||||||||||
22 | - | |||||||||||||||||||
23 | for (p = base; *
| 147069-4194796 | ||||||||||||||||||
24 | { | - | ||||||||||||||||||
25 | if (((*
| 115906-4078890 | ||||||||||||||||||
26 | saw_slash = executed 115906 times by 15 tests: saw_slash = 1 ; Executed by:
| 115906 | ||||||||||||||||||
27 | 1 executed 115906 times by 15 tests: saw_slash = 1 ; Executed by:
| 115906 | ||||||||||||||||||
28 | ; executed 115906 times by 15 tests: saw_slash = 1 ; Executed by:
| 115906 | ||||||||||||||||||
29 | else if (saw_slash
| 115839-3963051 | ||||||||||||||||||
30 | { | - | ||||||||||||||||||
31 | base = p; | - | ||||||||||||||||||
32 | saw_slash = | - | ||||||||||||||||||
33 | 0 | - | ||||||||||||||||||
34 | ; | - | ||||||||||||||||||
35 | } executed 115839 times by 15 tests: end of block Executed by:
| 115839 | ||||||||||||||||||
36 | } executed 4194796 times by 17 tests: end of block Executed by:
| 4194796 | ||||||||||||||||||
37 | - | |||||||||||||||||||
38 | return executed 147069 times by 17 tests: (char *) base;return (char *) base; Executed by:
executed 147069 times by 17 tests: return (char *) base; Executed by:
| 147069 | ||||||||||||||||||
39 | } | - | ||||||||||||||||||
40 | - | |||||||||||||||||||
41 | - | |||||||||||||||||||
42 | - | |||||||||||||||||||
43 | - | |||||||||||||||||||
44 | - | |||||||||||||||||||
45 | size_t | - | ||||||||||||||||||
46 | base_len (char const *name) | - | ||||||||||||||||||
47 | { | - | ||||||||||||||||||
48 | size_t len; | - | ||||||||||||||||||
49 | size_t prefix_len = 0; | - | ||||||||||||||||||
50 | - | |||||||||||||||||||
51 | for (len = strlen (name); 1 < len
| 52-136549 | ||||||||||||||||||
52 | continue; executed 52 times by 6 tests: continue; Executed by:
| 52 | ||||||||||||||||||
53 | - | |||||||||||||||||||
54 | if (0 && len == 1 dead code: len == 1 | - | ||||||||||||||||||
55 | && (( dead code: name[0]) == '/')((name[0]) == '/') dead code: && ((((name[0]) == '/') dead code: name[1]) == '/')((name[1]) == '/') dead code: && ! name[2]((name[1]) == '/') dead code: )! name[2] | - | ||||||||||||||||||
56 | return 2; dead code: return 2; | - | ||||||||||||||||||
57 | - | |||||||||||||||||||
58 | if (0 && prefix_len dead code: prefix_len | - | ||||||||||||||||||
59 | && len == prefix_len dead code: && ((len == prefix_len dead code: name[prefix_len]) == '/')((name[prefix_len]) == '/') dead code: )((name[prefix_len]) == '/') | - | ||||||||||||||||||
60 | return prefix_len + 1; dead code: return prefix_len + 1; | - | ||||||||||||||||||
61 | - | |||||||||||||||||||
62 | return executed 137015 times by 10 tests: len;return len; Executed by:
executed 137015 times by 10 tests: return len; Executed by:
| 137015 | ||||||||||||||||||
63 | } | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |