| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/canonicalize.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | static | - | ||||||||||||||||||||||||
| 5 | _Bool | - | ||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | seen_triple (Hash_table **ht, char const *filename, struct stat const *st) | - | ||||||||||||||||||||||||
| 8 | { | - | ||||||||||||||||||||||||
| 9 | if (*
| 45-130 | ||||||||||||||||||||||||
| 10 | ((void *)0)
| 45-130 | ||||||||||||||||||||||||
| 11 | ) | - | ||||||||||||||||||||||||
| 12 | { | - | ||||||||||||||||||||||||
| 13 | size_t initial_capacity = 7; | - | ||||||||||||||||||||||||
| 14 | *ht = hash_initialize (initial_capacity, | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | ((void *)0) | - | ||||||||||||||||||||||||
| 17 | , | - | ||||||||||||||||||||||||
| 18 | triple_hash, | - | ||||||||||||||||||||||||
| 19 | triple_compare_ino_str, | - | ||||||||||||||||||||||||
| 20 | triple_free); | - | ||||||||||||||||||||||||
| 21 | if (*
| 0-130 | ||||||||||||||||||||||||
| 22 | ((void *)0)
| 0-130 | ||||||||||||||||||||||||
| 23 | ) | - | ||||||||||||||||||||||||
| 24 | xalloc_die (); never executed: xalloc_die (); | 0 | ||||||||||||||||||||||||
| 25 | } executed 130 times by 3 tests: end of blockExecuted by:
| 130 | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | if (seen_file (*ht, filename, st)
| 10-165 | ||||||||||||||||||||||||
| 28 | return executed 10 times by 1 test: return 1 ;Executed by:
executed 10 times by 1 test: return 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 29 | 1 executed 10 times by 1 test: return 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 30 | ; executed 10 times by 1 test: return 1 ;Executed by:
| 10 | ||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | record_file (*ht, filename, st); | - | ||||||||||||||||||||||||
| 33 | return executed 165 times by 3 tests: return 0 ;Executed by:
executed 165 times by 3 tests: return 0 ;Executed by:
| 165 | ||||||||||||||||||||||||
| 34 | 0 executed 165 times by 3 tests: return 0 ;Executed by:
| 165 | ||||||||||||||||||||||||
| 35 | ; executed 165 times by 3 tests: return 0 ;Executed by:
| 165 | ||||||||||||||||||||||||
| 36 | } | - | ||||||||||||||||||||||||
| 37 | char * | - | ||||||||||||||||||||||||
| 38 | canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) | - | ||||||||||||||||||||||||
| 39 | { | - | ||||||||||||||||||||||||
| 40 | char *rname, *dest, *extra_buf = | - | ||||||||||||||||||||||||
| 41 | ((void *)0) | - | ||||||||||||||||||||||||
| 42 | ; | - | ||||||||||||||||||||||||
| 43 | char const *start; | - | ||||||||||||||||||||||||
| 44 | char const *end; | - | ||||||||||||||||||||||||
| 45 | char const *rname_limit; | - | ||||||||||||||||||||||||
| 46 | size_t extra_len = 0; | - | ||||||||||||||||||||||||
| 47 | Hash_table *ht = | - | ||||||||||||||||||||||||
| 48 | ((void *)0) | - | ||||||||||||||||||||||||
| 49 | ; | - | ||||||||||||||||||||||||
| 50 | int saved_errno; | - | ||||||||||||||||||||||||
| 51 | int can_flags = can_mode & ~(CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING); | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | _Bool | - | ||||||||||||||||||||||||
| 54 | logical = can_flags & CAN_NOLINKS; | - | ||||||||||||||||||||||||
| 55 | size_t prefix_len; | - | ||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | can_mode &= (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING); | - | ||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | if ((((
| 0-273 | ||||||||||||||||||||||||
| 60 | { | - | ||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||
| 62 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 63 | = | - | ||||||||||||||||||||||||
| 64 | 22 | - | ||||||||||||||||||||||||
| 65 | ; | - | ||||||||||||||||||||||||
| 66 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 67 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 68 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 69 | } | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | if (name ==
| 0-273 | ||||||||||||||||||||||||
| 72 | ((void *)0)
| 0-273 | ||||||||||||||||||||||||
| 73 | ) | - | ||||||||||||||||||||||||
| 74 | { | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 77 | = | - | ||||||||||||||||||||||||
| 78 | 22 | - | ||||||||||||||||||||||||
| 79 | ; | - | ||||||||||||||||||||||||
| 80 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 81 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 82 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
| 83 | } | - | ||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | if (name[0] == '\0'
| 3-270 | ||||||||||||||||||||||||
| 86 | { | - | ||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 89 | = | - | ||||||||||||||||||||||||
| 90 | 2 | - | ||||||||||||||||||||||||
| 91 | ; | - | ||||||||||||||||||||||||
| 92 | return executed 3 times by 2 tests: return ((void *)0) ;Executed by:
executed 3 times by 2 tests: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 93 | ((void *)0) executed 3 times by 2 tests: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 94 | ; executed 3 times by 2 tests: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 95 | } | - | ||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | prefix_len = 0; | - | ||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||
| 101 | if (!((((
| 0-135 | ||||||||||||||||||||||||
| 102 | { | - | ||||||||||||||||||||||||
| 103 | rname = xgetcwd (); | - | ||||||||||||||||||||||||
| 104 | if (!rname
| 3-132 | ||||||||||||||||||||||||
| 105 | return executed 3 times by 1 test: return ((void *)0) ;Executed by:
executed 3 times by 1 test: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 106 | ((void *)0) executed 3 times by 1 test: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 107 | ; executed 3 times by 1 test: return ((void *)0) ;Executed by:
| 3 | ||||||||||||||||||||||||
| 108 | dest = | - | ||||||||||||||||||||||||
| 109 | (__extension__ (__builtin_constant_p (
| 0-132 | ||||||||||||||||||||||||
| 110 | '\0'
| 0-132 | ||||||||||||||||||||||||
| 111 | )
| 0-132 | ||||||||||||||||||||||||
| 112 | rname
| 0-132 | ||||||||||||||||||||||||
| 113 | )
| 0-132 | ||||||||||||||||||||||||
| 114 | '\0'
| 0-132 | ||||||||||||||||||||||||
| 115 | ) == '\0'
| 0-132 | ||||||||||||||||||||||||
| 116 | rname | - | ||||||||||||||||||||||||
| 117 | , | - | ||||||||||||||||||||||||
| 118 | '\0' | - | ||||||||||||||||||||||||
| 119 | ) : __builtin_strchr ( | - | ||||||||||||||||||||||||
| 120 | rname | - | ||||||||||||||||||||||||
| 121 | , | - | ||||||||||||||||||||||||
| 122 | '\0' | - | ||||||||||||||||||||||||
| 123 | ))) | - | ||||||||||||||||||||||||
| 124 | ; | - | ||||||||||||||||||||||||
| 125 | if (dest - rname <
| 0-132 | ||||||||||||||||||||||||
| 126 | 4096
| 0-132 | ||||||||||||||||||||||||
| 127 | ) | - | ||||||||||||||||||||||||
| 128 | { | - | ||||||||||||||||||||||||
| 129 | char *p = xrealloc (rname, | - | ||||||||||||||||||||||||
| 130 | 4096 | - | ||||||||||||||||||||||||
| 131 | ); | - | ||||||||||||||||||||||||
| 132 | dest = p + (dest - rname); | - | ||||||||||||||||||||||||
| 133 | rname = p; | - | ||||||||||||||||||||||||
| 134 | rname_limit = rname + | - | ||||||||||||||||||||||||
| 135 | 4096 | - | ||||||||||||||||||||||||
| 136 | ; | - | ||||||||||||||||||||||||
| 137 | } executed 132 times by 3 tests: end of blockExecuted by:
| 132 | ||||||||||||||||||||||||
| 138 | else | - | ||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||
| 140 | rname_limit = dest; | - | ||||||||||||||||||||||||
| 141 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 142 | start = name; | - | ||||||||||||||||||||||||
| 143 | prefix_len = 0; | - | ||||||||||||||||||||||||
| 144 | } executed 132 times by 3 tests: end of blockExecuted by:
| 132 | ||||||||||||||||||||||||
| 145 | else | - | ||||||||||||||||||||||||
| 146 | { | - | ||||||||||||||||||||||||
| 147 | rname = xmalloc ( | - | ||||||||||||||||||||||||
| 148 | 4096 | - | ||||||||||||||||||||||||
| 149 | ); | - | ||||||||||||||||||||||||
| 150 | rname_limit = rname + | - | ||||||||||||||||||||||||
| 151 | 4096 | - | ||||||||||||||||||||||||
| 152 | ; | - | ||||||||||||||||||||||||
| 153 | dest = rname; | - | ||||||||||||||||||||||||
| 154 | if (prefix_len
| 0-135 | ||||||||||||||||||||||||
| 155 | { | - | ||||||||||||||||||||||||
| 156 | memcpy (rname, name, prefix_len); | - | ||||||||||||||||||||||||
| 157 | dest += prefix_len; | - | ||||||||||||||||||||||||
| 158 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 159 | *dest++ = '/'; | - | ||||||||||||||||||||||||
| 160 | if (0) | - | ||||||||||||||||||||||||
| 161 | { dead code: { if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 162 | if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) dead code: { if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 163 | *dest++ = '/'; dead code: { if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 164 | *dest = '\0'; dead code: { if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 165 | } dead code: { if (((name[1]) == '/') && !((name[2]) == '/') && !prefix_len) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 166 | start = name + prefix_len; | - | ||||||||||||||||||||||||
| 167 | } executed 135 times by 2 tests: end of blockExecuted by:
| 135 | ||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||
| 169 | for ( ; *
| 124-1351 | ||||||||||||||||||||||||
| 170 | { | - | ||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | while (((*
| 1121-1351 | ||||||||||||||||||||||||
| 173 | ++ executed 1121 times by 3 tests: start;++start;Executed by:
executed 1121 times by 3 tests: ++start;Executed by:
| 1121 | ||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | for (end = start; *
| 271-9435 | ||||||||||||||||||||||||
| 177 | ; executed 8355 times by 3 tests: ;Executed by:
| 8355 | ||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||
| 179 | if (end - start == 0
| 81-1270 | ||||||||||||||||||||||||
| 180 | break; executed 81 times by 2 tests: break;Executed by:
| 81 | ||||||||||||||||||||||||
| 181 | else if (end - start == 1
| 94-1036 | ||||||||||||||||||||||||
| 182 | ; executed 94 times by 3 tests: ;Executed by:
| 94 | ||||||||||||||||||||||||
| 183 | else if (end - start == 2
| 0-1154 | ||||||||||||||||||||||||
| 184 | { | - | ||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||
| 186 | if (dest > rname + prefix_len + 1
| 9-13 | ||||||||||||||||||||||||
| 187 | for (--dest; dest > rname
| 0-33 | ||||||||||||||||||||||||
| 188 | continue; executed 20 times by 3 tests: continue;Executed by:
| 20 | ||||||||||||||||||||||||
| 189 | if (0 && dest == rname + 1 dead code: dest == rname + 1 | - | ||||||||||||||||||||||||
| 190 | && !prefix_len dead code: && ((*!prefix_lendead code: dest) == '/')((*dest) == '/')dead code: && !((dest[1]) == '/')((*dest) == '/')dead code: )!((dest[1]) == '/') | - | ||||||||||||||||||||||||
| 191 | dest++; dead code: dest++; | - | ||||||||||||||||||||||||
| 192 | } executed 22 times by 3 tests: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||
| 193 | else | - | ||||||||||||||||||||||||
| 194 | { | - | ||||||||||||||||||||||||
| 195 | struct stat st; | - | ||||||||||||||||||||||||
| 196 | - | |||||||||||||||||||||||||
| 197 | if (!((dest[-1]) == '/')
| 265-889 | ||||||||||||||||||||||||
| 198 | * executed 889 times by 3 tests: dest++ = '/';*dest++ = '/';Executed by:
executed 889 times by 3 tests: *dest++ = '/';Executed by:
| 889 | ||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||
| 200 | if (dest + (end - start) >= rname_limit
| 0-1154 | ||||||||||||||||||||||||
| 201 | { | - | ||||||||||||||||||||||||
| 202 | ptrdiff_t dest_offset = dest - rname; | - | ||||||||||||||||||||||||
| 203 | size_t new_size = rname_limit - rname; | - | ||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||
| 205 | if (end - start + 1 >
| 0 | ||||||||||||||||||||||||
| 206 | 4096
| 0 | ||||||||||||||||||||||||
| 207 | ) | - | ||||||||||||||||||||||||
| 208 | new_size += end - start + 1; never executed: new_size += end - start + 1; | 0 | ||||||||||||||||||||||||
| 209 | else | - | ||||||||||||||||||||||||
| 210 | new_size += never executed: new_size += 4096 ; | 0 | ||||||||||||||||||||||||
| 211 | 4096 never executed: new_size += 4096 ; | 0 | ||||||||||||||||||||||||
| 212 | ; never executed: new_size += 4096 ; | 0 | ||||||||||||||||||||||||
| 213 | rname = xrealloc (rname, new_size); | - | ||||||||||||||||||||||||
| 214 | rname_limit = rname + new_size; | - | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | dest = rname + dest_offset; | - | ||||||||||||||||||||||||
| 217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||
| 219 | dest = memcpy (dest, start, end - start); | - | ||||||||||||||||||||||||
| 220 | dest += end - start; | - | ||||||||||||||||||||||||
| 221 | *dest = '\0'; | - | ||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||
| 223 | if (logical
| 2-1131 | ||||||||||||||||||||||||
| 224 | { | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | st.st_mode = 0; | - | ||||||||||||||||||||||||
| 229 | } executed 21 times by 1 test: end of blockExecuted by:
| 21 | ||||||||||||||||||||||||
| 230 | else if ((
| 2-1131 | ||||||||||||||||||||||||
| 231 | { | - | ||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | saved_errno = | - | ||||||||||||||||||||||||
| 234 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 235 | ; | - | ||||||||||||||||||||||||
| 236 | if (can_mode == CAN_EXISTING
| 18-115 | ||||||||||||||||||||||||
| 237 | goto executed 18 times by 1 test: error;goto error;Executed by:
executed 18 times by 1 test: goto error;Executed by:
| 18 | ||||||||||||||||||||||||
| 238 | if (can_mode == CAN_ALL_BUT_LAST
| 36-79 | ||||||||||||||||||||||||
| 239 | { | - | ||||||||||||||||||||||||
| 240 | if (end[
| 16-20 | ||||||||||||||||||||||||
| 241 | __builtin_strspn (
| 16-20 | ||||||||||||||||||||||||
| 242 | end
| 16-20 | ||||||||||||||||||||||||
| 243 | ,
| 16-20 | ||||||||||||||||||||||||
| 244 | "/"
| 16-20 | ||||||||||||||||||||||||
| 245 | )
| 16-20 | ||||||||||||||||||||||||
| 246 | ]
| 0-20 | ||||||||||||||||||||||||
| 247 | 2
| 0-20 | ||||||||||||||||||||||||
| 248 | ) | - | ||||||||||||||||||||||||
| 249 | goto executed 16 times by 1 test: error;goto error;Executed by:
executed 16 times by 1 test: goto error;Executed by:
| 16 | ||||||||||||||||||||||||
| 250 | continue; executed 20 times by 1 test: continue;Executed by:
| 20 | ||||||||||||||||||||||||
| 251 | } | - | ||||||||||||||||||||||||
| 252 | st.st_mode = 0; | - | ||||||||||||||||||||||||
| 253 | } executed 79 times by 3 tests: end of blockExecuted by:
| 79 | ||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||
| 255 | if ( | - | ||||||||||||||||||||||||
| 256 | ((((
| 175-925 | ||||||||||||||||||||||||
| 257 | st.st_mode
| 175-925 | ||||||||||||||||||||||||
| 258 | )) & 0170000) == (0120000))
| 175-925 | ||||||||||||||||||||||||
| 259 | ) | - | ||||||||||||||||||||||||
| 260 | { | - | ||||||||||||||||||||||||
| 261 | char *buf; | - | ||||||||||||||||||||||||
| 262 | size_t n, len; | - | ||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | if (seen_triple (&ht, name, &st)
| 10-165 | ||||||||||||||||||||||||
| 269 | { | - | ||||||||||||||||||||||||
| 270 | if (can_mode == CAN_MISSING
| 0-10 | ||||||||||||||||||||||||
| 271 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 272 | saved_errno = | - | ||||||||||||||||||||||||
| 273 | 40 | - | ||||||||||||||||||||||||
| 274 | ; | - | ||||||||||||||||||||||||
| 275 | goto executed 10 times by 1 test: error;goto error;Executed by:
executed 10 times by 1 test: goto error;Executed by:
| 10 | ||||||||||||||||||||||||
| 276 | } | - | ||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||
| 278 | buf = areadlink_with_size (rname, st.st_size); | - | ||||||||||||||||||||||||
| 279 | if (!buf
| 0-165 | ||||||||||||||||||||||||
| 280 | { | - | ||||||||||||||||||||||||
| 281 | if (can_mode == CAN_MISSING
| 0 | ||||||||||||||||||||||||
| 282 | (*
| 0 | ||||||||||||||||||||||||
| 283 | !=
| 0 | ||||||||||||||||||||||||
| 284 | 12
| 0 | ||||||||||||||||||||||||
| 285 | ) | - | ||||||||||||||||||||||||
| 286 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 287 | saved_errno = | - | ||||||||||||||||||||||||
| 288 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 289 | ; | - | ||||||||||||||||||||||||
| 290 | goto never executed: error;goto error;never executed: goto error; | 0 | ||||||||||||||||||||||||
| 291 | } | - | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | n = strlen (buf); | - | ||||||||||||||||||||||||
| 294 | len = strlen (end); | - | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 | if (!extra_len
| 35-130 | ||||||||||||||||||||||||
| 297 | { | - | ||||||||||||||||||||||||
| 298 | extra_len = | - | ||||||||||||||||||||||||
| 299 | ((
| 0-130 | ||||||||||||||||||||||||
| 300 | 4096
| 0-130 | ||||||||||||||||||||||||
| 301 | )
| 0-130 | ||||||||||||||||||||||||
| 302 | 4096 | - | ||||||||||||||||||||||||
| 303 | ; | - | ||||||||||||||||||||||||
| 304 | extra_buf = xmalloc (extra_len); | - | ||||||||||||||||||||||||
| 305 | } executed 130 times by 3 tests: end of blockExecuted by:
| 130 | ||||||||||||||||||||||||
| 306 | else if ((
| 0-35 | ||||||||||||||||||||||||
| 307 | { | - | ||||||||||||||||||||||||
| 308 | extra_len = n + len + 1; | - | ||||||||||||||||||||||||
| 309 | extra_buf = xrealloc (extra_buf, extra_len); | - | ||||||||||||||||||||||||
| 310 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | memmove (&extra_buf[n], end, len + 1); | - | ||||||||||||||||||||||||
| 314 | name = end = memcpy (extra_buf, buf, n); | - | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | if (((((
| 0-147 | ||||||||||||||||||||||||
| 317 | { | - | ||||||||||||||||||||||||
| 318 | size_t pfxlen = 0; | - | ||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | if (pfxlen
| 0-18 | ||||||||||||||||||||||||
| 321 | memcpy (rname, buf, pfxlen); never executed: memcpy (rname, buf, pfxlen); | 0 | ||||||||||||||||||||||||
| 322 | dest = rname + pfxlen; | - | ||||||||||||||||||||||||
| 323 | *dest++ = '/'; | - | ||||||||||||||||||||||||
| 324 | if (0) | - | ||||||||||||||||||||||||
| 325 | { dead code: { if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 326 | if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) dead code: { if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 327 | *dest++ = '/'; dead code: { if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 328 | *dest = '\0'; dead code: { if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 329 | } dead code: { if (((buf[1]) == '/') && !((buf[2]) == '/') && !pfxlen) *dest++ = '/'; *dest = '\0'; } | - | ||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | prefix_len = pfxlen; | - | ||||||||||||||||||||||||
| 332 | } executed 18 times by 2 tests: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||
| 333 | else | - | ||||||||||||||||||||||||
| 334 | { | - | ||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||
| 337 | if (dest > rname + prefix_len + 1
| 0-147 | ||||||||||||||||||||||||
| 338 | for (--dest; dest > rname
| 0-608 | ||||||||||||||||||||||||
| 339 | continue; executed 461 times by 3 tests: continue;Executed by:
| 461 | ||||||||||||||||||||||||
| 340 | if (0 && dest == rname + 1 dead code: dest == rname + 1 | - | ||||||||||||||||||||||||
| 341 | && ((* dead code: dest) == '/')((*dest) == '/')dead code: && !((dest[1]) == '/')((*dest) == '/')dead code: && !prefix_len!((dest[1]) == '/')dead code: )!prefix_len | - | ||||||||||||||||||||||||
| 342 | dest++; dead code: dest++; | - | ||||||||||||||||||||||||
| 343 | } executed 147 times by 3 tests: end of blockExecuted by:
| 147 | ||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | free (buf); | - | ||||||||||||||||||||||||
| 346 | } executed 165 times by 3 tests: end of blockExecuted by:
| 165 | ||||||||||||||||||||||||
| 347 | else | - | ||||||||||||||||||||||||
| 348 | { | - | ||||||||||||||||||||||||
| 349 | if (!
| 149-776 | ||||||||||||||||||||||||
| 350 | ((((
| 149-776 | ||||||||||||||||||||||||
| 351 | st.st_mode
| 149-776 | ||||||||||||||||||||||||
| 352 | )) & 0170000) == (0040000))
| 149-776 | ||||||||||||||||||||||||
| 353 | && *
| 18-76 | ||||||||||||||||||||||||
| 354 | { | - | ||||||||||||||||||||||||
| 355 | saved_errno = | - | ||||||||||||||||||||||||
| 356 | 20 | - | ||||||||||||||||||||||||
| 357 | ; | - | ||||||||||||||||||||||||
| 358 | goto executed 18 times by 1 test: error;goto error;Executed by:
executed 18 times by 1 test: goto error;Executed by:
| 18 | ||||||||||||||||||||||||
| 359 | } | - | ||||||||||||||||||||||||
| 360 | } executed 907 times by 3 tests: end of blockExecuted by:
| 907 | ||||||||||||||||||||||||
| 361 | } | - | ||||||||||||||||||||||||
| 362 | } | - | ||||||||||||||||||||||||
| 363 | if (dest > rname + prefix_len + 1
| 2-170 | ||||||||||||||||||||||||
| 364 | -- executed 2 times by 1 test: dest;--dest;Executed by:
executed 2 times by 1 test: --dest;Executed by:
| 2 | ||||||||||||||||||||||||
| 365 | if (0 && dest == rname + 1 dead code: && !prefix_lendest == rname + 1dead code: !prefix_len | - | ||||||||||||||||||||||||
| 366 | && ((* dead code: dest) == '/')((*dest) == '/')dead code: && !((dest[1]) == '/')((*dest) == '/')dead code: )!((dest[1]) == '/') | - | ||||||||||||||||||||||||
| 367 | dest++; dead code: dest++; | - | ||||||||||||||||||||||||
| 368 | *dest = '\0'; | - | ||||||||||||||||||||||||
| 369 | if (rname_limit != dest + 1
| 0-205 | ||||||||||||||||||||||||
| 370 | rname = xrealloc (rname, dest - rname + 1); executed 205 times by 3 tests: rname = xrealloc (rname, dest - rname + 1);Executed by:
| 205 | ||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | free (extra_buf); | - | ||||||||||||||||||||||||
| 373 | if (ht
| 84-121 | ||||||||||||||||||||||||
| 374 | hash_free (ht); executed 84 times by 3 tests: hash_free (ht);Executed by:
| 84 | ||||||||||||||||||||||||
| 375 | return executed 205 times by 3 tests: rname;return rname;Executed by:
executed 205 times by 3 tests: return rname;Executed by:
| 205 | ||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||
| 377 | error: | - | ||||||||||||||||||||||||
| 378 | free (extra_buf); | - | ||||||||||||||||||||||||
| 379 | free (rname); | - | ||||||||||||||||||||||||
| 380 | if (ht
| 16-46 | ||||||||||||||||||||||||
| 381 | hash_free (ht); executed 46 times by 1 test: hash_free (ht);Executed by:
| 46 | ||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||
| 383 | (*__errno_location ()) | - | ||||||||||||||||||||||||
| 384 | = saved_errno; | - | ||||||||||||||||||||||||
| 385 | return executed 62 times by 1 test: return ((void *)0) ;Executed by:
executed 62 times by 1 test: return ((void *)0) ;Executed by:
| 62 | ||||||||||||||||||||||||
| 386 | ((void *)0) executed 62 times by 1 test: return ((void *)0) ;Executed by:
| 62 | ||||||||||||||||||||||||
| 387 | ; executed 62 times by 1 test: return ((void *)0) ;Executed by:
| 62 | ||||||||||||||||||||||||
| 388 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |