OpenCoverage

mkancesdirs.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/mkancesdirs.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5ptrdiff_t-
6mkancesdirs (char *file, struct savewd *wd,-
7 int (*make_dir) (char const *, char const *, void *),-
8 void *make_dir_arg)-
9{-
10-
11-
12-
13 char *sep = -
14 ((void *)0)-
15 ;-
16-
17-
18-
19 char *component = file;-
20-
21 char *p = file + 0;-
22 char c;-
23 -
24 _Bool -
25 made_dir = -
26 0-
27 ;-
28-
29-
30-
31-
32-
33-
34-
35 while ((
(c = *p++)Description
TRUEevaluated 25026 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 123 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
c = *p++)
(c = *p++)Description
TRUEevaluated 25026 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 123 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
)
123-25026
36 if (((*
((*p) == '/')Description
TRUEevaluated 12388 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 12638 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
p) == '/')
((*p) == '/')Description
TRUEevaluated 12388 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 12638 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
)
12388-12638
37 {-
38 if (! ((c) == '/')
! ((c) == '/')Description
TRUEevaluated 12388 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEnever evaluated
)
0-12388
39 sep = p;
executed 12388 times by 2 tests: sep = p;
Executed by:
  • ginstall
  • mkdir
12388
40 }
executed 12388 times by 2 tests: end of block
Executed by:
  • ginstall
  • mkdir
12388
41 else if (((
((c) == '/')Description
TRUEevaluated 12391 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 247 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
c) == '/')
((c) == '/')Description
TRUEevaluated 12391 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 247 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
&& *
*pDescription
TRUEevaluated 12313 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 78 times by 1 test
Evaluated by:
  • mkdir
p
*pDescription
TRUEevaluated 12313 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 78 times by 1 test
Evaluated by:
  • mkdir
&& sep
sepDescription
TRUEevaluated 12310 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 3 times by 1 test
Evaluated by:
  • ginstall
)
3-12391
42 {-
43-
44-
45 if (! (sep - component == 1
sep - component == 1Description
TRUEevaluated 12285 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
&& component[0] == '.'
component[0] == '.'Description
TRUEnever evaluated
FALSEevaluated 12285 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
))
0-12285
46 {-
47 int make_dir_errno = 0;-
48 int savewd_chdir_options = 0;-
49 int chdir_result;-
50-
51-
52-
53 *sep = '\0';-
54-
55-
56-
57 if (sep - component == 2
sep - component == 2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • ginstall
FALSEevaluated 12308 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
2-12308
58 && component[0] == '.'
component[0] == '.'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • ginstall
&& component[1] == '.'
component[1] == '.'Description
TRUEnever evaluated
FALSEnever evaluated
)
0-2
59 made_dir =
never executed: made_dir = 0 ;
0
60 0
never executed: made_dir = 0 ;
0
61 ;
never executed: made_dir = 0 ;
0
62 else if (make_dir (file, component, make_dir_arg) < 0
make_dir (file...e_dir_arg) < 0Description
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 12138 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
)
172-12138
63 make_dir_errno =
executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ;
Executed by:
  • ginstall
  • mkdir
172
64 (*__errno_location ())
executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ;
Executed by:
  • ginstall
  • mkdir
172
65 ;
executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ;
Executed by:
  • ginstall
  • mkdir
172
66 else-
67 made_dir =
executed 12138 times by 2 tests: made_dir = 1 ;
Executed by:
  • ginstall
  • mkdir
12138
68 1
executed 12138 times by 2 tests: made_dir = 1 ;
Executed by:
  • ginstall
  • mkdir
12138
69 ;
executed 12138 times by 2 tests: made_dir = 1 ;
Executed by:
  • ginstall
  • mkdir
12138
70-
71 if (made_dir
made_dirDescription
TRUEevaluated 12138 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 172 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
)
172-12138
72 savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW;
executed 12138 times by 2 tests: savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW;
Executed by:
  • ginstall
  • mkdir
12138
73-
74 chdir_result =-
75 savewd_chdir (wd, component, savewd_chdir_options, -
76 ((void *)0)-
77 );-
78-
79-
80-
81 if (chdir_result != -1
chdir_result != -1Description
TRUEevaluated 12309 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
FALSEevaluated 1 time by 1 test
Evaluated by:
  • ginstall
)
1-12309
82 *
executed 12309 times by 2 tests: *sep = '/';
Executed by:
  • ginstall
  • mkdir
sep = '/';
executed 12309 times by 2 tests: *sep = '/';
Executed by:
  • ginstall
  • mkdir
12309
83-
84 if (chdir_result != 0
chdir_result != 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • ginstall
FALSEevaluated 12305 times by 2 tests
Evaluated by:
  • ginstall
  • mkdir
)
5-12305
85 {-
86 if (make_dir_errno != 0
make_dir_errno != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • ginstall
FALSEevaluated 1 time by 1 test
Evaluated by:
  • ginstall
&&
1-4
87 (*
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • ginstall
__errno_location ())
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • ginstall
0-4
88 ==
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • ginstall
0-4
89 2
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • ginstall
0-4
90 )-
91 -
92 (*
never executed: (*__errno_location ()) = make_dir_errno;
__errno_location ())
never executed: (*__errno_location ()) = make_dir_errno;
0
93 = make_dir_errno;
never executed: (*__errno_location ()) = make_dir_errno;
0
94 return
executed 5 times by 1 test: return chdir_result;
Executed by:
  • ginstall
chdir_result;
executed 5 times by 1 test: return chdir_result;
Executed by:
  • ginstall
5
95 }-
96 }
executed 12305 times by 2 tests: end of block
Executed by:
  • ginstall
  • mkdir
12305
97-
98 component = p;-
99 }
executed 12305 times by 2 tests: end of block
Executed by:
  • ginstall
  • mkdir
12305
100-
101 return
executed 123 times by 2 tests: return component - file;
Executed by:
  • ginstall
  • mkdir
component - file;
executed 123 times by 2 tests: return component - file;
Executed by:
  • ginstall
  • mkdir
123
102}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2