| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/rmdir.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | - | |||||||||||||||||||
| 9 | static | - | ||||||||||||||||||
| 10 | _Bool | - | ||||||||||||||||||
| 11 | remove_empty_parents; | - | ||||||||||||||||||
| 12 | - | |||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | - | |||||||||||||||||||
| 15 | static | - | ||||||||||||||||||
| 16 | _Bool | - | ||||||||||||||||||
| 17 | ignore_fail_on_non_empty; | - | ||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | static | - | ||||||||||||||||||
| 21 | _Bool | - | ||||||||||||||||||
| 22 | verbose; | - | ||||||||||||||||||
| 23 | - | |||||||||||||||||||
| 24 | - | |||||||||||||||||||
| 25 | - | |||||||||||||||||||
| 26 | enum | - | ||||||||||||||||||
| 27 | { | - | ||||||||||||||||||
| 28 | IGNORE_FAIL_ON_NON_EMPTY_OPTION = 0x7f + 1 | - | ||||||||||||||||||
| 29 | }; | - | ||||||||||||||||||
| 30 | - | |||||||||||||||||||
| 31 | static struct option const longopts[] = | - | ||||||||||||||||||
| 32 | { | - | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | {"ignore-fail-on-non-empty", | - | ||||||||||||||||||
| 36 | 0 | - | ||||||||||||||||||
| 37 | , | - | ||||||||||||||||||
| 38 | ((void *)0) | - | ||||||||||||||||||
| 39 | , | - | ||||||||||||||||||
| 40 | IGNORE_FAIL_ON_NON_EMPTY_OPTION}, | - | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | {"path", | - | ||||||||||||||||||
| 43 | 0 | - | ||||||||||||||||||
| 44 | , | - | ||||||||||||||||||
| 45 | ((void *)0) | - | ||||||||||||||||||
| 46 | , 'p'}, | - | ||||||||||||||||||
| 47 | {"parents", | - | ||||||||||||||||||
| 48 | 0 | - | ||||||||||||||||||
| 49 | , | - | ||||||||||||||||||
| 50 | ((void *)0) | - | ||||||||||||||||||
| 51 | , 'p'}, | - | ||||||||||||||||||
| 52 | {"verbose", | - | ||||||||||||||||||
| 53 | 0 | - | ||||||||||||||||||
| 54 | , | - | ||||||||||||||||||
| 55 | ((void *)0) | - | ||||||||||||||||||
| 56 | , 'v'}, | - | ||||||||||||||||||
| 57 | {"help", | - | ||||||||||||||||||
| 58 | 0 | - | ||||||||||||||||||
| 59 | , | - | ||||||||||||||||||
| 60 | ((void *)0) | - | ||||||||||||||||||
| 61 | , GETOPT_HELP_CHAR}, | - | ||||||||||||||||||
| 62 | {"version", | - | ||||||||||||||||||
| 63 | 0 | - | ||||||||||||||||||
| 64 | , | - | ||||||||||||||||||
| 65 | ((void *)0) | - | ||||||||||||||||||
| 66 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||||||||
| 67 | { | - | ||||||||||||||||||
| 68 | ((void *)0) | - | ||||||||||||||||||
| 69 | , 0, | - | ||||||||||||||||||
| 70 | ((void *)0) | - | ||||||||||||||||||
| 71 | , 0} | - | ||||||||||||||||||
| 72 | }; | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | static | - | ||||||||||||||||||
| 77 | _Bool | - | ||||||||||||||||||
| 78 | - | |||||||||||||||||||
| 79 | errno_rmdir_non_empty (int error_number) | - | ||||||||||||||||||
| 80 | { | - | ||||||||||||||||||
| 81 | return executed 1 time by 1 test: error_number == return error_number == 39 || error_number == 17 ;Executed by:
executed 1 time by 1 test: return error_number == 39 || error_number == 17 ;Executed by:
| 1 | ||||||||||||||||||
| 82 | 39 executed 1 time by 1 test: return error_number == 39 || error_number == 17 ;Executed by:
| 1 | ||||||||||||||||||
| 83 | || error_number == executed 1 time by 1 test: return error_number == 39 || error_number == 17 ;Executed by:
| 1 | ||||||||||||||||||
| 84 | 17 executed 1 time by 1 test: return error_number == 39 || error_number == 17 ;Executed by:
| 1 | ||||||||||||||||||
| 85 | ; executed 1 time by 1 test: return error_number == 39 || error_number == 17 ;Executed by:
| 1 | ||||||||||||||||||
| 86 | } | - | ||||||||||||||||||
| 87 | - | |||||||||||||||||||
| 88 | - | |||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | static | - | ||||||||||||||||||
| 91 | _Bool | - | ||||||||||||||||||
| 92 | - | |||||||||||||||||||
| 93 | errno_may_be_empty (int error_number) | - | ||||||||||||||||||
| 94 | { | - | ||||||||||||||||||
| 95 | switch (error_number) | - | ||||||||||||||||||
| 96 | { | - | ||||||||||||||||||
| 97 | case never executed: case 13 :never executed: case 13 : | 0 | ||||||||||||||||||
| 98 | 13 never executed: case 13 : | 0 | ||||||||||||||||||
| 99 | : never executed: case 13 : | 0 | ||||||||||||||||||
| 100 | case never executed: case 1 :never executed: case 1 : | 0 | ||||||||||||||||||
| 101 | 1 never executed: case 1 : | 0 | ||||||||||||||||||
| 102 | : never executed: case 1 : | 0 | ||||||||||||||||||
| 103 | case never executed: case 30 :never executed: case 30 : | 0 | ||||||||||||||||||
| 104 | 30 never executed: case 30 : | 0 | ||||||||||||||||||
| 105 | : never executed: case 30 : | 0 | ||||||||||||||||||
| 106 | case never executed: case 17 :never executed: case 17 : | 0 | ||||||||||||||||||
| 107 | 17 never executed: case 17 : | 0 | ||||||||||||||||||
| 108 | : never executed: case 17 : | 0 | ||||||||||||||||||
| 109 | case never executed: case 16 :never executed: case 16 : | 0 | ||||||||||||||||||
| 110 | 16 never executed: case 16 : | 0 | ||||||||||||||||||
| 111 | : never executed: case 16 : | 0 | ||||||||||||||||||
| 112 | return never executed: return 1 ;never executed: return 1 ; | 0 | ||||||||||||||||||
| 113 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||
| 114 | ; never executed: return 1 ; | 0 | ||||||||||||||||||
| 115 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 116 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||
| 117 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||
| 118 | ; never executed: return 0 ; | 0 | ||||||||||||||||||
| 119 | } | - | ||||||||||||||||||
| 120 | } | - | ||||||||||||||||||
| 121 | - | |||||||||||||||||||
| 122 | - | |||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | static | - | ||||||||||||||||||
| 125 | _Bool | - | ||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | ignorable_failure (int error_number, char const *dir) | - | ||||||||||||||||||
| 128 | { | - | ||||||||||||||||||
| 129 | return executed 3 times by 1 test: (ignore_fail_on_non_emptyreturn (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 130 | && (errno_rmdir_non_empty (error_number) executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 131 | || (errno_may_be_empty (error_number) executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 132 | && is_empty_dir ( executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 133 | -100 executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 134 | , dir)))); executed 3 times by 1 test: return (ignore_fail_on_non_empty && (errno_rmdir_non_empty (error_number) || (errno_may_be_empty (error_number) && is_empty_dir ( -100 , dir))));Executed by:
| 3 | ||||||||||||||||||
| 135 | } | - | ||||||||||||||||||
| 136 | - | |||||||||||||||||||
| 137 | - | |||||||||||||||||||
| 138 | - | |||||||||||||||||||
| 139 | - | |||||||||||||||||||
| 140 | - | |||||||||||||||||||
| 141 | - | |||||||||||||||||||
| 142 | static | - | ||||||||||||||||||
| 143 | _Bool | - | ||||||||||||||||||
| 144 | - | |||||||||||||||||||
| 145 | remove_parents (char *dir) | - | ||||||||||||||||||
| 146 | { | - | ||||||||||||||||||
| 147 | char *slash; | - | ||||||||||||||||||
| 148 | - | |||||||||||||||||||
| 149 | _Bool | - | ||||||||||||||||||
| 150 | ok = | - | ||||||||||||||||||
| 151 | 1 | - | ||||||||||||||||||
| 152 | ; | - | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | strip_trailing_slashes (dir); | - | ||||||||||||||||||
| 155 | while (1) | - | ||||||||||||||||||
| 156 | { | - | ||||||||||||||||||
| 157 | slash = strrchr (dir, '/'); | - | ||||||||||||||||||
| 158 | if (slash ==
| 1-3 | ||||||||||||||||||
| 159 | ((void *)0)
| 1-3 | ||||||||||||||||||
| 160 | ) | - | ||||||||||||||||||
| 161 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||
| 162 | - | |||||||||||||||||||
| 163 | - | |||||||||||||||||||
| 164 | while (slash > dir
| 0-6 | ||||||||||||||||||
| 165 | -- executed 3 times by 1 test: slash;--slash;Executed by:
executed 3 times by 1 test: --slash;Executed by:
| 3 | ||||||||||||||||||
| 166 | slash[1] = 0; | - | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | - | |||||||||||||||||||
| 169 | if (verbose
| 0-3 | ||||||||||||||||||
| 170 | prog_fprintf ( never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 171 | stdout never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 172 | , never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 173 | dcgettext (((void *)0), never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 174 | "removing directory, %s" never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 175 | , 5) never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 176 | , quotearg_style (shell_escape_always_quoting_style, dir)); never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 177 | - | |||||||||||||||||||
| 178 | ok = (rmdir (dir) == 0); | - | ||||||||||||||||||
| 179 | - | |||||||||||||||||||
| 180 | if (!ok
| 1-2 | ||||||||||||||||||
| 181 | { | - | ||||||||||||||||||
| 182 | - | |||||||||||||||||||
| 183 | if (ignorable_failure (
| 1 | ||||||||||||||||||
| 184 | (*__errno_location ())
| 1 | ||||||||||||||||||
| 185 | , dir)
| 1 | ||||||||||||||||||
| 186 | { | - | ||||||||||||||||||
| 187 | ok = | - | ||||||||||||||||||
| 188 | 1 | - | ||||||||||||||||||
| 189 | ; | - | ||||||||||||||||||
| 190 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 191 | else | - | ||||||||||||||||||
| 192 | { | - | ||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | error (0, | - | ||||||||||||||||||
| 195 | (*__errno_location ()) | - | ||||||||||||||||||
| 196 | , | - | ||||||||||||||||||
| 197 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 198 | "failed to remove directory %s" | - | ||||||||||||||||||
| 199 | , 5) | - | ||||||||||||||||||
| 200 | , | - | ||||||||||||||||||
| 201 | quotearg_style (shell_escape_always_quoting_style, dir)); | - | ||||||||||||||||||
| 202 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 203 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 204 | } | - | ||||||||||||||||||
| 205 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 206 | return executed 3 times by 1 test: ok;return ok;Executed by:
executed 3 times by 1 test: return ok;Executed by:
| 3 | ||||||||||||||||||
| 207 | } | - | ||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | void | - | ||||||||||||||||||
| 210 | usage (int status) | - | ||||||||||||||||||
| 211 | { | - | ||||||||||||||||||
| 212 | if (status !=
| 3-8 | ||||||||||||||||||
| 213 | 0
| 3-8 | ||||||||||||||||||
| 214 | ) | - | ||||||||||||||||||
| 215 | do { fprintf ( | - | ||||||||||||||||||
| 216 | stderr | - | ||||||||||||||||||
| 217 | , | - | ||||||||||||||||||
| 218 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 219 | "Try '%s --help' for more information.\n" | - | ||||||||||||||||||
| 220 | , 5) | - | ||||||||||||||||||
| 221 | , program_name); } executed 3 times by 1 test: while (0);end of blockExecuted by:
| 3 | ||||||||||||||||||
| 222 | else | - | ||||||||||||||||||
| 223 | { | - | ||||||||||||||||||
| 224 | printf ( | - | ||||||||||||||||||
| 225 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 226 | "Usage: %s [OPTION]... DIRECTORY...\n" | - | ||||||||||||||||||
| 227 | , 5) | - | ||||||||||||||||||
| 228 | , program_name); | - | ||||||||||||||||||
| 229 | fputs_unlocked ( | - | ||||||||||||||||||
| 230 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 231 | "Remove the DIRECTORY(ies), if they are empty.\n\n --ignore-fail-on-non-empty\n ignore each failure that is solely because a directory\n is non-empty\n" | - | ||||||||||||||||||
| 232 | , 5) | - | ||||||||||||||||||
| 233 | , | - | ||||||||||||||||||
| 234 | stdout | - | ||||||||||||||||||
| 235 | ) | - | ||||||||||||||||||
| 236 | - | |||||||||||||||||||
| 237 | - | |||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | - | |||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | ; | - | ||||||||||||||||||
| 242 | fputs_unlocked ( | - | ||||||||||||||||||
| 243 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 244 | " -p, --parents remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c' is\n similar to 'rmdir a/b/c a/b a'\n -v, --verbose output a diagnostic for every directory processed\n" | - | ||||||||||||||||||
| 245 | , 5) | - | ||||||||||||||||||
| 246 | , | - | ||||||||||||||||||
| 247 | stdout | - | ||||||||||||||||||
| 248 | ) | - | ||||||||||||||||||
| 249 | - | |||||||||||||||||||
| 250 | - | |||||||||||||||||||
| 251 | - | |||||||||||||||||||
| 252 | - | |||||||||||||||||||
| 253 | ; | - | ||||||||||||||||||
| 254 | fputs_unlocked ( | - | ||||||||||||||||||
| 255 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 256 | " --help display this help and exit\n" | - | ||||||||||||||||||
| 257 | , 5) | - | ||||||||||||||||||
| 258 | , | - | ||||||||||||||||||
| 259 | stdout | - | ||||||||||||||||||
| 260 | ); | - | ||||||||||||||||||
| 261 | fputs_unlocked ( | - | ||||||||||||||||||
| 262 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 263 | " --version output version information and exit\n" | - | ||||||||||||||||||
| 264 | , 5) | - | ||||||||||||||||||
| 265 | , | - | ||||||||||||||||||
| 266 | stdout | - | ||||||||||||||||||
| 267 | ); | - | ||||||||||||||||||
| 268 | emit_ancillary_info ("rmdir"); | - | ||||||||||||||||||
| 269 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||
| 270 | exit (status); executed 11 times by 1 test: exit (status);Executed by:
| 11 | ||||||||||||||||||
| 271 | } | - | ||||||||||||||||||
| 272 | - | |||||||||||||||||||
| 273 | int | - | ||||||||||||||||||
| 274 | main (int argc, char **argv) | - | ||||||||||||||||||
| 275 | { | - | ||||||||||||||||||
| 276 | - | |||||||||||||||||||
| 277 | _Bool | - | ||||||||||||||||||
| 278 | ok = | - | ||||||||||||||||||
| 279 | 1 | - | ||||||||||||||||||
| 280 | ; | - | ||||||||||||||||||
| 281 | int optc; | - | ||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | ; | - | ||||||||||||||||||
| 284 | set_program_name (argv[0]); | - | ||||||||||||||||||
| 285 | setlocale ( | - | ||||||||||||||||||
| 286 | 6 | - | ||||||||||||||||||
| 287 | , ""); | - | ||||||||||||||||||
| 288 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||||||||
| 289 | textdomain ("coreutils"); | - | ||||||||||||||||||
| 290 | - | |||||||||||||||||||
| 291 | atexit (close_stdout); | - | ||||||||||||||||||
| 292 | - | |||||||||||||||||||
| 293 | remove_empty_parents = | - | ||||||||||||||||||
| 294 | 0 | - | ||||||||||||||||||
| 295 | ; | - | ||||||||||||||||||
| 296 | - | |||||||||||||||||||
| 297 | while ((
| 16-26 | ||||||||||||||||||
| 298 | ((void *)0)
| 16-26 | ||||||||||||||||||
| 299 | )) != -1
| 16-26 | ||||||||||||||||||
| 300 | { | - | ||||||||||||||||||
| 301 | switch (optc) | - | ||||||||||||||||||
| 302 | { | - | ||||||||||||||||||
| 303 | case executed 5 times by 1 test: 'p':case 'p':Executed by:
executed 5 times by 1 test: case 'p':Executed by:
| 5 | ||||||||||||||||||
| 304 | remove_empty_parents = | - | ||||||||||||||||||
| 305 | 1 | - | ||||||||||||||||||
| 306 | ; | - | ||||||||||||||||||
| 307 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||
| 308 | case executed 2 times by 1 test: IGNORE_FAIL_ON_NON_EMPTY_OPTION:case IGNORE_FAIL_ON_NON_EMPTY_OPTION:Executed by:
executed 2 times by 1 test: case IGNORE_FAIL_ON_NON_EMPTY_OPTION:Executed by:
| 2 | ||||||||||||||||||
| 309 | ignore_fail_on_non_empty = | - | ||||||||||||||||||
| 310 | 1 | - | ||||||||||||||||||
| 311 | ; | - | ||||||||||||||||||
| 312 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 313 | case executed 2 times by 1 test: 'v':case 'v':Executed by:
executed 2 times by 1 test: case 'v':Executed by:
| 2 | ||||||||||||||||||
| 314 | verbose = | - | ||||||||||||||||||
| 315 | 1 | - | ||||||||||||||||||
| 316 | ; | - | ||||||||||||||||||
| 317 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 318 | case executed 8 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 8 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 8 | ||||||||||||||||||
| 319 | 0 | - | ||||||||||||||||||
| 320 | ); break; never executed: ;break; | 0 | ||||||||||||||||||
| 321 | case executed 6 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR:Executed by:
executed 6 times by 1 test: version_etc (case GETOPT_VERSION_CHAR:Executed by:
| 6 | ||||||||||||||||||
| 322 | stdout | - | ||||||||||||||||||
| 323 | , "rmdir", "GNU coreutils", Version, ("David MacKenzie"), (char *) | - | ||||||||||||||||||
| 324 | ((void *)0) | - | ||||||||||||||||||
| 325 | ); exit ( executed 6 times by 1 test: exit ( 0 );Executed by:
| 6 | ||||||||||||||||||
| 326 | 0 executed 6 times by 1 test: exit ( 0 );Executed by:
| 6 | ||||||||||||||||||
| 327 | ); executed 6 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-6 | ||||||||||||||||||
| 328 | default executed 3 times by 1 test: :default:Executed by:
executed 3 times by 1 test: default:Executed by:
| 3 | ||||||||||||||||||
| 329 | usage ( | - | ||||||||||||||||||
| 330 | 1 | - | ||||||||||||||||||
| 331 | ); | - | ||||||||||||||||||
| 332 | } never executed: end of block | 0 | ||||||||||||||||||
| 333 | } | - | ||||||||||||||||||
| 334 | - | |||||||||||||||||||
| 335 | if (optind == argc
| 0-16 | ||||||||||||||||||
| 336 | { | - | ||||||||||||||||||
| 337 | error (0, 0, | - | ||||||||||||||||||
| 338 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 339 | "missing operand" | - | ||||||||||||||||||
| 340 | , 5) | - | ||||||||||||||||||
| 341 | ); | - | ||||||||||||||||||
| 342 | usage ( | - | ||||||||||||||||||
| 343 | 1 | - | ||||||||||||||||||
| 344 | ); | - | ||||||||||||||||||
| 345 | } never executed: end of block | 0 | ||||||||||||||||||
| 346 | - | |||||||||||||||||||
| 347 | for (; optind < argc
| 16-17 | ||||||||||||||||||
| 348 | { | - | ||||||||||||||||||
| 349 | char *dir = argv[optind]; | - | ||||||||||||||||||
| 350 | - | |||||||||||||||||||
| 351 | - | |||||||||||||||||||
| 352 | if (verbose
| 0-17 | ||||||||||||||||||
| 353 | prog_fprintf ( never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 354 | stdout never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 355 | , never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 356 | dcgettext (((void *)0), never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 357 | "removing directory, %s" never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 358 | , 5) never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 359 | , quotearg_style (shell_escape_always_quoting_style, dir)); never executed: prog_fprintf ( stdout , dcgettext (((void *)0), "removing directory, %s" , 5) , quotearg_style (shell_escape_always_quoting_style, dir)); | 0 | ||||||||||||||||||
| 360 | - | |||||||||||||||||||
| 361 | if (rmdir (dir) != 0
| 1-16 | ||||||||||||||||||
| 362 | { | - | ||||||||||||||||||
| 363 | if (ignorable_failure (
| 0-1 | ||||||||||||||||||
| 364 | (*__errno_location ())
| 0-1 | ||||||||||||||||||
| 365 | , dir)
| 0-1 | ||||||||||||||||||
| 366 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | error (0, | - | ||||||||||||||||||
| 371 | (*__errno_location ()) | - | ||||||||||||||||||
| 372 | , | - | ||||||||||||||||||
| 373 | dcgettext (((void *)0), | - | ||||||||||||||||||
| 374 | "failed to remove %s" | - | ||||||||||||||||||
| 375 | , 5) | - | ||||||||||||||||||
| 376 | , quotearg_style (shell_escape_always_quoting_style, dir)); | - | ||||||||||||||||||
| 377 | ok = | - | ||||||||||||||||||
| 378 | 0 | - | ||||||||||||||||||
| 379 | ; | - | ||||||||||||||||||
| 380 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 381 | else if (remove_empty_parents
| 3-13 | ||||||||||||||||||
| 382 | { | - | ||||||||||||||||||
| 383 | ok &= remove_parents (dir); | - | ||||||||||||||||||
| 384 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||
| 385 | } executed 17 times by 1 test: end of blockExecuted by:
| 17 | ||||||||||||||||||
| 386 | - | |||||||||||||||||||
| 387 | return executed 16 times by 1 test: ok ? return ok ? 0 : 1 ;Executed by:
executed 16 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 16 | ||||||||||||||||||
| 388 | 0 executed 16 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 16 | ||||||||||||||||||
| 389 | : executed 16 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 16 | ||||||||||||||||||
| 390 | 1 executed 16 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 16 | ||||||||||||||||||
| 391 | ; executed 16 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 16 | ||||||||||||||||||
| 392 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |