OpenCoverage

basename.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/basename.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4char *-
5base_name (char const *name)-
6{-
7 char const *base = last_component (name);-
8 size_t length;-
9-
10-
11-
12 if (! *base
! *baseDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • basename
FALSEevaluated 34 times by 1 test
Evaluated by:
  • basename
)
6-34
13 return
executed 6 times by 1 test: return xstrndup (name, base_len (name));
Executed by:
  • basename
xstrndup (name, base_len (name));
executed 6 times by 1 test: return xstrndup (name, base_len (name));
Executed by:
  • basename
6
14-
15-
16 length = base_len (base);-
17 if (((
((base[length]) == '/')Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • basename
FALSEevaluated 29 times by 1 test
Evaluated by:
  • basename
base[length]) == '/')
((base[length]) == '/')Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • basename
FALSEevaluated 29 times by 1 test
Evaluated by:
  • basename
)
5-29
18 length++;
executed 5 times by 1 test: length++;
Executed by:
  • basename
5
19-
20-
21-
22-
23 if (0)-
24 {
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
25 char *p = xmalloc (length + 3);
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
26 p[0] = '.';
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
27 p[1] = '/';
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
28 memcpy (p + 2, base, length);
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
29 p[length + 2] = '\0';
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
30 return p;
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
31 }
dead code: { char *p = xmalloc (length + 3); p[0] = '.'; p[1] = '/'; memcpy (p + 2, base, length); p[length + 2] = '\0'; return p; }
-
32-
33-
34 return
executed 34 times by 1 test: return xstrndup (base, length);
Executed by:
  • basename
xstrndup (base, length);
executed 34 times by 1 test: return xstrndup (base, length);
Executed by:
  • basename
34
35}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2