| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/head.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | static | - | ||||||||||||||||||||||||||||||||||||
| 6 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 7 | presume_input_pipe; | - | ||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||
| 10 | static | - | ||||||||||||||||||||||||||||||||||||
| 11 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 12 | print_headers; | - | ||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||||||||
| 15 | static char line_end; | - | ||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||
| 18 | enum header_mode | - | ||||||||||||||||||||||||||||||||||||
| 19 | { | - | ||||||||||||||||||||||||||||||||||||
| 20 | multiple_files, always, never | - | ||||||||||||||||||||||||||||||||||||
| 21 | }; | - | ||||||||||||||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||||||||||||||
| 24 | static | - | ||||||||||||||||||||||||||||||||||||
| 25 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 26 | have_read_stdin; | - | ||||||||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||||||||
| 28 | enum Copy_fd_status | - | ||||||||||||||||||||||||||||||||||||
| 29 | { | - | ||||||||||||||||||||||||||||||||||||
| 30 | COPY_FD_OK = 0, | - | ||||||||||||||||||||||||||||||||||||
| 31 | COPY_FD_READ_ERROR, | - | ||||||||||||||||||||||||||||||||||||
| 32 | COPY_FD_UNEXPECTED_EOF | - | ||||||||||||||||||||||||||||||||||||
| 33 | }; | - | ||||||||||||||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||||||||
| 37 | enum | - | ||||||||||||||||||||||||||||||||||||
| 38 | { | - | ||||||||||||||||||||||||||||||||||||
| 39 | PRESUME_INPUT_PIPE_OPTION = 0x7f + 1 | - | ||||||||||||||||||||||||||||||||||||
| 40 | }; | - | ||||||||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||||||||
| 42 | static struct option const long_options[] = | - | ||||||||||||||||||||||||||||||||||||
| 43 | { | - | ||||||||||||||||||||||||||||||||||||
| 44 | {"bytes", | - | ||||||||||||||||||||||||||||||||||||
| 45 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 46 | , | - | ||||||||||||||||||||||||||||||||||||
| 47 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 48 | , 'c'}, | - | ||||||||||||||||||||||||||||||||||||
| 49 | {"lines", | - | ||||||||||||||||||||||||||||||||||||
| 50 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 51 | , | - | ||||||||||||||||||||||||||||||||||||
| 52 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 53 | , 'n'}, | - | ||||||||||||||||||||||||||||||||||||
| 54 | {"-presume-input-pipe", | - | ||||||||||||||||||||||||||||||||||||
| 55 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 56 | , | - | ||||||||||||||||||||||||||||||||||||
| 57 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 58 | , | - | ||||||||||||||||||||||||||||||||||||
| 59 | PRESUME_INPUT_PIPE_OPTION}, | - | ||||||||||||||||||||||||||||||||||||
| 60 | {"quiet", | - | ||||||||||||||||||||||||||||||||||||
| 61 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 62 | , | - | ||||||||||||||||||||||||||||||||||||
| 63 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 64 | , 'q'}, | - | ||||||||||||||||||||||||||||||||||||
| 65 | {"silent", | - | ||||||||||||||||||||||||||||||||||||
| 66 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 67 | , | - | ||||||||||||||||||||||||||||||||||||
| 68 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 69 | , 'q'}, | - | ||||||||||||||||||||||||||||||||||||
| 70 | {"verbose", | - | ||||||||||||||||||||||||||||||||||||
| 71 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 72 | , | - | ||||||||||||||||||||||||||||||||||||
| 73 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 74 | , 'v'}, | - | ||||||||||||||||||||||||||||||||||||
| 75 | {"zero-terminated", | - | ||||||||||||||||||||||||||||||||||||
| 76 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 77 | , | - | ||||||||||||||||||||||||||||||||||||
| 78 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 79 | , 'z'}, | - | ||||||||||||||||||||||||||||||||||||
| 80 | {"help", | - | ||||||||||||||||||||||||||||||||||||
| 81 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 82 | , | - | ||||||||||||||||||||||||||||||||||||
| 83 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 84 | , GETOPT_HELP_CHAR}, | - | ||||||||||||||||||||||||||||||||||||
| 85 | {"version", | - | ||||||||||||||||||||||||||||||||||||
| 86 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 87 | , | - | ||||||||||||||||||||||||||||||||||||
| 88 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 89 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||||||||||||||||||||||||||
| 90 | { | - | ||||||||||||||||||||||||||||||||||||
| 91 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 92 | , 0, | - | ||||||||||||||||||||||||||||||||||||
| 93 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 94 | , 0} | - | ||||||||||||||||||||||||||||||||||||
| 95 | }; | - | ||||||||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||||||||
| 97 | void | - | ||||||||||||||||||||||||||||||||||||
| 98 | usage (int status) | - | ||||||||||||||||||||||||||||||||||||
| 99 | { | - | ||||||||||||||||||||||||||||||||||||
| 100 | if (status !=
| 3-10 | ||||||||||||||||||||||||||||||||||||
| 101 | 0
| 3-10 | ||||||||||||||||||||||||||||||||||||
| 102 | ) | - | ||||||||||||||||||||||||||||||||||||
| 103 | do { fprintf ( | - | ||||||||||||||||||||||||||||||||||||
| 104 | stderr | - | ||||||||||||||||||||||||||||||||||||
| 105 | , | - | ||||||||||||||||||||||||||||||||||||
| 106 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 107 | "Try '%s --help' for more information.\n" | - | ||||||||||||||||||||||||||||||||||||
| 108 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 109 | , program_name); } executed 3 times by 1 test: while (0);end of blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 110 | else | - | ||||||||||||||||||||||||||||||||||||
| 111 | { | - | ||||||||||||||||||||||||||||||||||||
| 112 | printf ( | - | ||||||||||||||||||||||||||||||||||||
| 113 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 114 | "Usage: %s [OPTION]... [FILE]...\n" | - | ||||||||||||||||||||||||||||||||||||
| 115 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||||||||
| 118 | , | - | ||||||||||||||||||||||||||||||||||||
| 119 | program_name); | - | ||||||||||||||||||||||||||||||||||||
| 120 | printf ( | - | ||||||||||||||||||||||||||||||||||||
| 121 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 122 | "Print the first %d lines of each FILE to standard output.\nWith more than one FILE, precede each with a header giving the file name.\n" | - | ||||||||||||||||||||||||||||||||||||
| 123 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||||||||||||||
| 127 | , 10); | - | ||||||||||||||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||||||||||||||
| 129 | emit_stdin_note (); | - | ||||||||||||||||||||||||||||||||||||
| 130 | emit_mandatory_arg_note (); | - | ||||||||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||||||||
| 132 | printf ( | - | ||||||||||||||||||||||||||||||||||||
| 133 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 134 | " -c, --bytes=[-]NUM print the first NUM bytes of each file;\n with the leading '-', print all but the last\n NUM bytes of each file\n -n, --lines=[-]NUM print the first NUM lines instead of the first %d;\n with the leading '-', print all but the last\n NUM lines of each file\n" | - | ||||||||||||||||||||||||||||||||||||
| 135 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||||||||||||||
| 143 | , 10); | - | ||||||||||||||||||||||||||||||||||||
| 144 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 145 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 146 | " -q, --quiet, --silent never print headers giving file names\n -v, --verbose always print headers giving file names\n" | - | ||||||||||||||||||||||||||||||||||||
| 147 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 148 | , | - | ||||||||||||||||||||||||||||||||||||
| 149 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 150 | ) | - | ||||||||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||||||||
| 153 | ; | - | ||||||||||||||||||||||||||||||||||||
| 154 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 155 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 156 | " -z, --zero-terminated line delimiter is NUL, not newline\n" | - | ||||||||||||||||||||||||||||||||||||
| 157 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 158 | , | - | ||||||||||||||||||||||||||||||||||||
| 159 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 160 | ) | - | ||||||||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||||||||
| 162 | ; | - | ||||||||||||||||||||||||||||||||||||
| 163 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 164 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 165 | " --help display this help and exit\n" | - | ||||||||||||||||||||||||||||||||||||
| 166 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 167 | , | - | ||||||||||||||||||||||||||||||||||||
| 168 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 169 | ); | - | ||||||||||||||||||||||||||||||||||||
| 170 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 171 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 172 | " --version output version information and exit\n" | - | ||||||||||||||||||||||||||||||||||||
| 173 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 174 | , | - | ||||||||||||||||||||||||||||||||||||
| 175 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 176 | ); | - | ||||||||||||||||||||||||||||||||||||
| 177 | fputs_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 178 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 179 | "\nNUM may have a multiplier suffix:\nb 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\nGB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n" | - | ||||||||||||||||||||||||||||||||||||
| 180 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 181 | , | - | ||||||||||||||||||||||||||||||||||||
| 182 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 183 | ) | - | ||||||||||||||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||||||||||||||
| 188 | ; | - | ||||||||||||||||||||||||||||||||||||
| 189 | emit_ancillary_info ("head"); | - | ||||||||||||||||||||||||||||||||||||
| 190 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 191 | exit (status); executed 13 times by 1 test: exit (status);Executed by:
| 13 | ||||||||||||||||||||||||||||||||||||
| 192 | } | - | ||||||||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||||||||
| 194 | static void | - | ||||||||||||||||||||||||||||||||||||
| 195 | diagnose_copy_fd_failure (enum Copy_fd_status err, char const *filename) | - | ||||||||||||||||||||||||||||||||||||
| 196 | { | - | ||||||||||||||||||||||||||||||||||||
| 197 | switch (err) | - | ||||||||||||||||||||||||||||||||||||
| 198 | { | - | ||||||||||||||||||||||||||||||||||||
| 199 | case never executed: COPY_FD_READ_ERROR:case COPY_FD_READ_ERROR:never executed: case COPY_FD_READ_ERROR: | 0 | ||||||||||||||||||||||||||||||||||||
| 200 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 201 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 202 | , | - | ||||||||||||||||||||||||||||||||||||
| 203 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 204 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 205 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 206 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 207 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 208 | case never executed: COPY_FD_UNEXPECTED_EOF:case COPY_FD_UNEXPECTED_EOF:never executed: case COPY_FD_UNEXPECTED_EOF: | 0 | ||||||||||||||||||||||||||||||||||||
| 209 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 210 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 211 | , | - | ||||||||||||||||||||||||||||||||||||
| 212 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 213 | "%s: file has shrunk too much" | - | ||||||||||||||||||||||||||||||||||||
| 214 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 215 | , quotearg_n_style_colon (0, shell_escape_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 216 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 217 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 218 | abort (); never executed: abort (); | 0 | ||||||||||||||||||||||||||||||||||||
| 219 | } | - | ||||||||||||||||||||||||||||||||||||
| 220 | } | - | ||||||||||||||||||||||||||||||||||||
| 221 | - | |||||||||||||||||||||||||||||||||||||
| 222 | static void | - | ||||||||||||||||||||||||||||||||||||
| 223 | write_header (const char *filename) | - | ||||||||||||||||||||||||||||||||||||
| 224 | { | - | ||||||||||||||||||||||||||||||||||||
| 225 | static | - | ||||||||||||||||||||||||||||||||||||
| 226 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 227 | first_file = | - | ||||||||||||||||||||||||||||||||||||
| 228 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 229 | ; | - | ||||||||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||||||||
| 231 | printf ("%s==> %s <==\n", (first_file ? "" : "\n"), filename); | - | ||||||||||||||||||||||||||||||||||||
| 232 | first_file = | - | ||||||||||||||||||||||||||||||||||||
| 233 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 234 | ; | - | ||||||||||||||||||||||||||||||||||||
| 235 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||||||||||||||
| 240 | static void | - | ||||||||||||||||||||||||||||||||||||
| 241 | xwrite_stdout (char const *buffer, size_t n_bytes) | - | ||||||||||||||||||||||||||||||||||||
| 242 | { | - | ||||||||||||||||||||||||||||||||||||
| 243 | if (n_bytes > 0
| 1-3748 | ||||||||||||||||||||||||||||||||||||
| 244 | (
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 245 | 1
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 246 | )
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 247 | n_bytes
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 248 | )
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 249 | 1
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 250 | ) * (size_t) (
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 251 | n_bytes
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 252 | ) <= 8
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 253 | 1
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 254 | ) != 0
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 255 | buffer
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 256 | ); FILE *__stream = (stdout); size_t __cnt; for (__cnt = (size_t) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 257 | 1
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 258 | ) * (size_t) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 259 | n_bytes
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 260 | ); __cnt > 0
never executed: ((size_t) (break;
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 261 | 1
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 262 | ) * (size_t) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 263 | n_bytes
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 264 | ) - __cnt) / (size_t) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 265 | 1
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 266 | ); }) : (((__builtin_constant_p (
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 267 | 1
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 268 | )
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 269 | 1
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 270 | ) == 0
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 271 | n_bytes
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 272 | )
| 0-3748 | ||||||||||||||||||||||||||||||||||||
| 273 | n_bytes
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 274 | ) == 0
| 0-3740 | ||||||||||||||||||||||||||||||||||||
| 275 | buffer
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 276 | ), (void) (stdout), (void) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 277 | 1
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 278 | ), (void) (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 279 | n_bytes
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 280 | ), (size_t) 0) : fwrite_unlocked (
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 281 | buffer
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 282 | ,
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 283 | 1
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 284 | ,
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 285 | n_bytes
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 286 | , stdout))))
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 287 | < n_bytes
| 8-3740 | ||||||||||||||||||||||||||||||||||||
| 288 | { | - | ||||||||||||||||||||||||||||||||||||
| 289 | clearerr_unlocked ( | - | ||||||||||||||||||||||||||||||||||||
| 290 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 291 | ); | - | ||||||||||||||||||||||||||||||||||||
| 292 | ((!!sizeof (struct { _Static_assert ( | - | ||||||||||||||||||||||||||||||||||||
| 293 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 294 | , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error writing %s\", 5), quotearg_style (shell_escape_always_quoting_style, \"standard output\")), assume (false))" ")"); int _gl_dummy; })) ? ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 295 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 296 | , | - | ||||||||||||||||||||||||||||||||||||
| 297 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 298 | , | - | ||||||||||||||||||||||||||||||||||||
| 299 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 300 | "error writing %s" | - | ||||||||||||||||||||||||||||||||||||
| 301 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 302 | , quotearg_style (shell_escape_always_quoting_style, "standard output")), (( | - | ||||||||||||||||||||||||||||||||||||
| 303 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 304 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 305 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 306 | , | - | ||||||||||||||||||||||||||||||||||||
| 307 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 308 | , | - | ||||||||||||||||||||||||||||||||||||
| 309 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 310 | "error writing %s" | - | ||||||||||||||||||||||||||||||||||||
| 311 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 312 | , quotearg_style (shell_escape_always_quoting_style, "standard output")), (( | - | ||||||||||||||||||||||||||||||||||||
| 313 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 314 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||||||||||||||||||||||||||
| 315 | ; | - | ||||||||||||||||||||||||||||||||||||
| 316 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 317 | } executed 3741 times by 1 test: end of blockExecuted by:
| 3741 | ||||||||||||||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||||||||||||||
| 322 | static enum Copy_fd_status | - | ||||||||||||||||||||||||||||||||||||
| 323 | copy_fd (int src_fd, uintmax_t n_bytes) | - | ||||||||||||||||||||||||||||||||||||
| 324 | { | - | ||||||||||||||||||||||||||||||||||||
| 325 | char buf[ | - | ||||||||||||||||||||||||||||||||||||
| 326 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 327 | ]; | - | ||||||||||||||||||||||||||||||||||||
| 328 | const size_t buf_size = sizeof (buf); | - | ||||||||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||||||||
| 331 | while (0 < n_bytes
| 3-20 | ||||||||||||||||||||||||||||||||||||
| 332 | { | - | ||||||||||||||||||||||||||||||||||||
| 333 | size_t n_to_read = | - | ||||||||||||||||||||||||||||||||||||
| 334 | (((
| 3-17 | ||||||||||||||||||||||||||||||||||||
| 335 | buf_size
| 3-17 | ||||||||||||||||||||||||||||||||||||
| 336 | )<(
| 3-17 | ||||||||||||||||||||||||||||||||||||
| 337 | n_bytes
| 3-17 | ||||||||||||||||||||||||||||||||||||
| 338 | ))
| 3-17 | ||||||||||||||||||||||||||||||||||||
| 339 | buf_size | - | ||||||||||||||||||||||||||||||||||||
| 340 | ):( | - | ||||||||||||||||||||||||||||||||||||
| 341 | n_bytes | - | ||||||||||||||||||||||||||||||||||||
| 342 | )) | - | ||||||||||||||||||||||||||||||||||||
| 343 | ; | - | ||||||||||||||||||||||||||||||||||||
| 344 | size_t n_read = safe_read (src_fd, buf, n_to_read); | - | ||||||||||||||||||||||||||||||||||||
| 345 | if (n_read == ((size_t) -1)
| 0-20 | ||||||||||||||||||||||||||||||||||||
| 346 | return never executed: COPY_FD_READ_ERROR;return COPY_FD_READ_ERROR;never executed: return COPY_FD_READ_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||||||||||||||
| 348 | n_bytes -= n_read; | - | ||||||||||||||||||||||||||||||||||||
| 349 | - | |||||||||||||||||||||||||||||||||||||
| 350 | if (n_read == 0
| 0-20 | ||||||||||||||||||||||||||||||||||||
| 351 | return never executed: COPY_FD_UNEXPECTED_EOF;return COPY_FD_UNEXPECTED_EOF;never executed: return COPY_FD_UNEXPECTED_EOF; | 0 | ||||||||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||||||||
| 353 | xwrite_stdout (buf, n_read); | - | ||||||||||||||||||||||||||||||||||||
| 354 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 355 | - | |||||||||||||||||||||||||||||||||||||
| 356 | return executed 3 times by 1 test: COPY_FD_OK;return COPY_FD_OK;Executed by:
executed 3 times by 1 test: return COPY_FD_OK;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 357 | } | - | ||||||||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||||||||||||||
| 362 | - | |||||||||||||||||||||||||||||||||||||
| 363 | - | |||||||||||||||||||||||||||||||||||||
| 364 | static off_t | - | ||||||||||||||||||||||||||||||||||||
| 365 | elseek (int fd, off_t offset, int whence, char const *filename) | - | ||||||||||||||||||||||||||||||||||||
| 366 | { | - | ||||||||||||||||||||||||||||||||||||
| 367 | off_t new_offset = lseek (fd, offset, whence); | - | ||||||||||||||||||||||||||||||||||||
| 368 | char buf[((((((sizeof (offset) * 8) - (! ((__typeof__ (offset)) 0 < (__typeof__ (offset)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (offset)) 0 < (__typeof__ (offset)) -1))) + 1)]; | - | ||||||||||||||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||||||||||||||
| 370 | if (new_offset < 0
| 0-2052 | ||||||||||||||||||||||||||||||||||||
| 371 | error (0, never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 372 | (*__errno_location ()) never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 373 | , never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 374 | never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 375 | dcgettext (((void *)0), never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 376 | whence == never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 377 | 0 never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 378 | ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 379 | , 5) never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 380 | 0 | |||||||||||||||||||||||||||||||||||||
| 381 | never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 382 | , never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 383 | quotearg_n_style_colon (0, shell_escape_quoting_style, filename), never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 384 | offtostr (offset, buf)); never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), whence == 0 ? "%s: cannot seek to offset %s" : "%s: cannot seek to relative offset %s" , 5) , quotearg_n_style_colon (0, shell_escape_quoting_style, filename), offtostr (offset, buf)); | 0 | ||||||||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||||||||
| 386 | return executed 2052 times by 1 test: new_offset;return new_offset;Executed by:
executed 2052 times by 1 test: return new_offset;Executed by:
| 2052 | ||||||||||||||||||||||||||||||||||||
| 387 | } | - | ||||||||||||||||||||||||||||||||||||
| 388 | static | - | ||||||||||||||||||||||||||||||||||||
| 389 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||||||||||||||
| 391 | elide_tail_bytes_pipe (const char *filename, int fd, uintmax_t n_elide_0, | - | ||||||||||||||||||||||||||||||||||||
| 392 | off_t current_pos) | - | ||||||||||||||||||||||||||||||||||||
| 393 | { | - | ||||||||||||||||||||||||||||||||||||
| 394 | size_t n_elide = n_elide_0; | - | ||||||||||||||||||||||||||||||||||||
| 395 | uintmax_t desired_pos = current_pos; | - | ||||||||||||||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||||||||||||||
| 397 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 398 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 399 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 400 | ; | - | ||||||||||||||||||||||||||||||||||||
| 401 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 402 | (
| 0-955 | ||||||||||||||||||||||||||||||||||||
| 403 | < n_elide_0 +
| 0-955 | ||||||||||||||||||||||||||||||||||||
| 404 | 8192
| 0-955 | ||||||||||||||||||||||||||||||||||||
| 405 | ) | - | ||||||||||||||||||||||||||||||||||||
| 406 | { | - | ||||||||||||||||||||||||||||||||||||
| 407 | char umax_buf[((((((sizeof (n_elide_0) * 8) - (! ((__typeof__ (n_elide_0)) 0 < (__typeof__ (n_elide_0)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (n_elide_0)) 0 < (__typeof__ (n_elide_0)) -1))) + 1)]; | - | ||||||||||||||||||||||||||||||||||||
| 408 | ((!!sizeof (struct { _Static_assert ( | - | ||||||||||||||||||||||||||||||||||||
| 409 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 410 | , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"%s: number of bytes is too large\", 5), umaxtostr (n_elide_0, umax_buf)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 411 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 412 | , 0, | - | ||||||||||||||||||||||||||||||||||||
| 413 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 414 | "%s: number of bytes is too large" | - | ||||||||||||||||||||||||||||||||||||
| 415 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 416 | , umaxtostr (n_elide_0, umax_buf)), (( | - | ||||||||||||||||||||||||||||||||||||
| 417 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 418 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 419 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 420 | , 0, | - | ||||||||||||||||||||||||||||||||||||
| 421 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 422 | "%s: number of bytes is too large" | - | ||||||||||||||||||||||||||||||||||||
| 423 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 424 | , umaxtostr (n_elide_0, umax_buf)), (( | - | ||||||||||||||||||||||||||||||||||||
| 425 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 426 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||||||||||||||||||||||||||
| 427 | ; | - | ||||||||||||||||||||||||||||||||||||
| 428 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 429 | if (n_elide <= 1024 * 1024
| 1-954 | ||||||||||||||||||||||||||||||||||||
| 430 | { | - | ||||||||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||||||||
| 432 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 433 | first = | - | ||||||||||||||||||||||||||||||||||||
| 434 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 435 | ; | - | ||||||||||||||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||||||||||||||
| 437 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 438 | eof = | - | ||||||||||||||||||||||||||||||||||||
| 439 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 440 | ; | - | ||||||||||||||||||||||||||||||||||||
| 441 | size_t n_to_read = | - | ||||||||||||||||||||||||||||||||||||
| 442 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 443 | + n_elide; | - | ||||||||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||||||||
| 445 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 446 | i; | - | ||||||||||||||||||||||||||||||||||||
| 447 | char *b[2]; | - | ||||||||||||||||||||||||||||||||||||
| 448 | b[0] = xnmalloc (2, n_to_read); | - | ||||||||||||||||||||||||||||||||||||
| 449 | b[1] = b[0] + n_to_read; | - | ||||||||||||||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||||||||||||||
| 451 | for (i = | - | ||||||||||||||||||||||||||||||||||||
| 452 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 453 | ; ! eof
| 952-954 | ||||||||||||||||||||||||||||||||||||
| 454 | { | - | ||||||||||||||||||||||||||||||||||||
| 455 | size_t n_read = full_read (fd, b[i], n_to_read); | - | ||||||||||||||||||||||||||||||||||||
| 456 | size_t delta = 0; | - | ||||||||||||||||||||||||||||||||||||
| 457 | if (n_read < n_to_read
| 2-952 | ||||||||||||||||||||||||||||||||||||
| 458 | { | - | ||||||||||||||||||||||||||||||||||||
| 459 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 460 | (*
| 0-952 | ||||||||||||||||||||||||||||||||||||
| 461 | != 0
| 0-952 | ||||||||||||||||||||||||||||||||||||
| 462 | { | - | ||||||||||||||||||||||||||||||||||||
| 463 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 464 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 465 | , | - | ||||||||||||||||||||||||||||||||||||
| 466 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 467 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 468 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 469 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 470 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 471 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 472 | ; | - | ||||||||||||||||||||||||||||||||||||
| 473 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 474 | } | - | ||||||||||||||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||||||||||||||
| 476 | - | |||||||||||||||||||||||||||||||||||||
| 477 | if (n_read <= n_elide
| 464-488 | ||||||||||||||||||||||||||||||||||||
| 478 | { | - | ||||||||||||||||||||||||||||||||||||
| 479 | if (first
| 0-464 | ||||||||||||||||||||||||||||||||||||
| 480 | { | - | ||||||||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||||||||||||||
| 484 | } executed 464 times by 1 test: end of blockExecuted by:
| 464 | ||||||||||||||||||||||||||||||||||||
| 485 | else | - | ||||||||||||||||||||||||||||||||||||
| 486 | { | - | ||||||||||||||||||||||||||||||||||||
| 487 | delta = n_elide - n_read; | - | ||||||||||||||||||||||||||||||||||||
| 488 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 489 | } | - | ||||||||||||||||||||||||||||||||||||
| 490 | eof = | - | ||||||||||||||||||||||||||||||||||||
| 491 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 492 | ; | - | ||||||||||||||||||||||||||||||||||||
| 493 | } executed 952 times by 1 test: end of blockExecuted by:
| 952 | ||||||||||||||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||||||||||||||
| 497 | if (! first
| 0-954 | ||||||||||||||||||||||||||||||||||||
| 498 | { | - | ||||||||||||||||||||||||||||||||||||
| 499 | desired_pos += n_elide - delta; | - | ||||||||||||||||||||||||||||||||||||
| 500 | xwrite_stdout (b[!i] + | - | ||||||||||||||||||||||||||||||||||||
| 501 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 502 | , n_elide - delta); | - | ||||||||||||||||||||||||||||||||||||
| 503 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 504 | first = | - | ||||||||||||||||||||||||||||||||||||
| 505 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 506 | ; | - | ||||||||||||||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||||||||||||||
| 508 | if (n_elide < n_read
| 464-490 | ||||||||||||||||||||||||||||||||||||
| 509 | { | - | ||||||||||||||||||||||||||||||||||||
| 510 | desired_pos += n_read - n_elide; | - | ||||||||||||||||||||||||||||||||||||
| 511 | xwrite_stdout (b[i], n_read - n_elide); | - | ||||||||||||||||||||||||||||||||||||
| 512 | } executed 488 times by 1 test: end of blockExecuted by:
| 488 | ||||||||||||||||||||||||||||||||||||
| 513 | } executed 952 times by 1 test: end of blockExecuted by:
| 952 | ||||||||||||||||||||||||||||||||||||
| 514 | - | |||||||||||||||||||||||||||||||||||||
| 515 | free (b[0]); | - | ||||||||||||||||||||||||||||||||||||
| 516 | } executed 952 times by 1 test: end of blockExecuted by:
| 952 | ||||||||||||||||||||||||||||||||||||
| 517 | else | - | ||||||||||||||||||||||||||||||||||||
| 518 | { | - | ||||||||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||||||||||||||
| 521 | - | |||||||||||||||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||||||||||||||
| 523 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 524 | eof = | - | ||||||||||||||||||||||||||||||||||||
| 525 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 526 | ; | - | ||||||||||||||||||||||||||||||||||||
| 527 | size_t n_read; | - | ||||||||||||||||||||||||||||||||||||
| 528 | - | |||||||||||||||||||||||||||||||||||||
| 529 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 530 | buffered_enough; | - | ||||||||||||||||||||||||||||||||||||
| 531 | size_t i, i_next; | - | ||||||||||||||||||||||||||||||||||||
| 532 | char **b = | - | ||||||||||||||||||||||||||||||||||||
| 533 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 534 | ; | - | ||||||||||||||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||||||||||||||
| 536 | size_t rem = | - | ||||||||||||||||||||||||||||||||||||
| 537 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 538 | - (n_elide % | - | ||||||||||||||||||||||||||||||||||||
| 539 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 540 | ); | - | ||||||||||||||||||||||||||||||||||||
| 541 | size_t n_elide_round = n_elide + rem; | - | ||||||||||||||||||||||||||||||||||||
| 542 | size_t n_bufs = n_elide_round / | - | ||||||||||||||||||||||||||||||||||||
| 543 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 544 | + 1; | - | ||||||||||||||||||||||||||||||||||||
| 545 | size_t n_alloc = 0; | - | ||||||||||||||||||||||||||||||||||||
| 546 | size_t n_array_alloc = 0; | - | ||||||||||||||||||||||||||||||||||||
| 547 | - | |||||||||||||||||||||||||||||||||||||
| 548 | buffered_enough = | - | ||||||||||||||||||||||||||||||||||||
| 549 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 550 | ; | - | ||||||||||||||||||||||||||||||||||||
| 551 | for (i = 0, i_next = 1; !eof
| 1 | ||||||||||||||||||||||||||||||||||||
| 552 | { | - | ||||||||||||||||||||||||||||||||||||
| 553 | if (n_array_alloc == i
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 554 | { | - | ||||||||||||||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||||||||||||||
| 556 | if (n_array_alloc == 0
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 557 | n_array_alloc = executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 558 | (((
executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 559 | n_bufs
executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 560 | )<(
executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 561 | 16
executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 562 | ))
executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 563 | n_bufs executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 564 | ):( executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 565 | 16 executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 566 | )) executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 567 | ; executed 1 time by 1 test: n_array_alloc = ((( n_bufs )<( 16 ))?( n_bufs ):( 16 )) ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 568 | else if (n_array_alloc <= n_bufs / 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 569 | n_array_alloc *= 2; never executed: n_array_alloc *= 2; | 0 | ||||||||||||||||||||||||||||||||||||
| 570 | else | - | ||||||||||||||||||||||||||||||||||||
| 571 | n_array_alloc = n_bufs; never executed: n_array_alloc = n_bufs; | 0 | ||||||||||||||||||||||||||||||||||||
| 572 | b = xnrealloc (b, n_array_alloc, sizeof *b); | - | ||||||||||||||||||||||||||||||||||||
| 573 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 574 | - | |||||||||||||||||||||||||||||||||||||
| 575 | if (! buffered_enough
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 576 | { | - | ||||||||||||||||||||||||||||||||||||
| 577 | b[i] = xmalloc ( | - | ||||||||||||||||||||||||||||||||||||
| 578 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 579 | ); | - | ||||||||||||||||||||||||||||||||||||
| 580 | n_alloc = i + 1; | - | ||||||||||||||||||||||||||||||||||||
| 581 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 582 | n_read = full_read (fd, b[i], | - | ||||||||||||||||||||||||||||||||||||
| 583 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 584 | ); | - | ||||||||||||||||||||||||||||||||||||
| 585 | if (n_read <
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 586 | 8192
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 587 | ) | - | ||||||||||||||||||||||||||||||||||||
| 588 | { | - | ||||||||||||||||||||||||||||||||||||
| 589 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 590 | (*
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 591 | != 0
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 592 | { | - | ||||||||||||||||||||||||||||||||||||
| 593 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 594 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 595 | , | - | ||||||||||||||||||||||||||||||||||||
| 596 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 597 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 598 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 599 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 600 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 601 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 602 | ; | - | ||||||||||||||||||||||||||||||||||||
| 603 | goto never executed: free_mem;goto free_mem;never executed: goto free_mem; | 0 | ||||||||||||||||||||||||||||||||||||
| 604 | } | - | ||||||||||||||||||||||||||||||||||||
| 605 | eof = | - | ||||||||||||||||||||||||||||||||||||
| 606 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 607 | ; | - | ||||||||||||||||||||||||||||||||||||
| 608 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||||||||||||||
| 610 | if (i + 1 == n_bufs
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 611 | buffered_enough = never executed: buffered_enough = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 612 | 1 never executed: buffered_enough = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 613 | ; never executed: buffered_enough = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 614 | - | |||||||||||||||||||||||||||||||||||||
| 615 | if (buffered_enough
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 616 | { | - | ||||||||||||||||||||||||||||||||||||
| 617 | desired_pos += n_read; | - | ||||||||||||||||||||||||||||||||||||
| 618 | xwrite_stdout (b[i_next], n_read); | - | ||||||||||||||||||||||||||||||||||||
| 619 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 620 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||||||||||||||
| 623 | if (rem
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 624 | { | - | ||||||||||||||||||||||||||||||||||||
| 625 | if (buffered_enough
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 626 | { | - | ||||||||||||||||||||||||||||||||||||
| 627 | size_t n_bytes_left_in_b_i = | - | ||||||||||||||||||||||||||||||||||||
| 628 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 629 | - n_read; | - | ||||||||||||||||||||||||||||||||||||
| 630 | desired_pos += rem; | - | ||||||||||||||||||||||||||||||||||||
| 631 | if (rem < n_bytes_left_in_b_i
| 0 | ||||||||||||||||||||||||||||||||||||
| 632 | { | - | ||||||||||||||||||||||||||||||||||||
| 633 | xwrite_stdout (b[i] + n_read, rem); | - | ||||||||||||||||||||||||||||||||||||
| 634 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 635 | else | - | ||||||||||||||||||||||||||||||||||||
| 636 | { | - | ||||||||||||||||||||||||||||||||||||
| 637 | xwrite_stdout (b[i] + n_read, n_bytes_left_in_b_i); | - | ||||||||||||||||||||||||||||||||||||
| 638 | xwrite_stdout (b[i_next], rem - n_bytes_left_in_b_i); | - | ||||||||||||||||||||||||||||||||||||
| 639 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 640 | } | - | ||||||||||||||||||||||||||||||||||||
| 641 | else if (i + 1 == n_bufs
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 642 | { | - | ||||||||||||||||||||||||||||||||||||
| 643 | size_t y = | - | ||||||||||||||||||||||||||||||||||||
| 644 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 645 | - rem; | - | ||||||||||||||||||||||||||||||||||||
| 646 | size_t x = n_read - y; | - | ||||||||||||||||||||||||||||||||||||
| 647 | desired_pos += x; | - | ||||||||||||||||||||||||||||||||||||
| 648 | xwrite_stdout (b[i_next], x); | - | ||||||||||||||||||||||||||||||||||||
| 649 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 650 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 651 | - | |||||||||||||||||||||||||||||||||||||
| 652 | free_mem: code before this statement executed 1 time by 1 test: free_mem:Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 653 | for (i = 0; i < n_alloc
| 1 | ||||||||||||||||||||||||||||||||||||
| 654 | free (b[i]); executed 1 time by 1 test: free (b[i]);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 655 | free (b); | - | ||||||||||||||||||||||||||||||||||||
| 656 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 657 | - | |||||||||||||||||||||||||||||||||||||
| 658 | if (0 <= current_pos
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 659 | 0
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 660 | , filename) < 0
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 661 | ok = never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 662 | 0 never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 663 | ; never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 664 | return executed 953 times by 1 test: ok;return ok;Executed by:
executed 953 times by 1 test: return ok;Executed by:
| 953 | ||||||||||||||||||||||||||||||||||||
| 665 | } | - | ||||||||||||||||||||||||||||||||||||
| 666 | static | - | ||||||||||||||||||||||||||||||||||||
| 667 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 668 | - | |||||||||||||||||||||||||||||||||||||
| 669 | elide_tail_bytes_file (const char *filename, int fd, uintmax_t n_elide, | - | ||||||||||||||||||||||||||||||||||||
| 670 | struct stat const *st, off_t current_pos) | - | ||||||||||||||||||||||||||||||||||||
| 671 | { | - | ||||||||||||||||||||||||||||||||||||
| 672 | off_t size = st->st_size; | - | ||||||||||||||||||||||||||||||||||||
| 673 | if (presume_input_pipe
| 0-518 | ||||||||||||||||||||||||||||||||||||
| 674 | 512
| 4-509 | ||||||||||||||||||||||||||||||||||||
| 675 | )
| 4-509 | ||||||||||||||||||||||||||||||||||||
| 676 | return executed 955 times by 1 test: elide_tail_bytes_pipe (filename, fd, n_elide, current_pos);return elide_tail_bytes_pipe (filename, fd, n_elide, current_pos);Executed by:
executed 955 times by 1 test: return elide_tail_bytes_pipe (filename, fd, n_elide, current_pos);Executed by:
| 955 | ||||||||||||||||||||||||||||||||||||
| 677 | else | - | ||||||||||||||||||||||||||||||||||||
| 678 | { | - | ||||||||||||||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||||||||||||||
| 680 | - | |||||||||||||||||||||||||||||||||||||
| 681 | off_t diff = size - current_pos; | - | ||||||||||||||||||||||||||||||||||||
| 682 | off_t bytes_remaining = diff < 0
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||||||||||||||
| 684 | if (bytes_remaining <= n_elide
| 0-4 | ||||||||||||||||||||||||||||||||||||
| 685 | return never executed: return 1 ;never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 686 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 687 | ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||||||||||||||
| 689 | enum Copy_fd_status err = copy_fd (fd, bytes_remaining - n_elide); | - | ||||||||||||||||||||||||||||||||||||
| 690 | if (err == COPY_FD_OK
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 691 | return executed 2 times by 1 test: return 1 ;Executed by:
executed 2 times by 1 test: return 1 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 692 | 1 executed 2 times by 1 test: return 1 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 693 | ; executed 2 times by 1 test: return 1 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 694 | - | |||||||||||||||||||||||||||||||||||||
| 695 | diagnose_copy_fd_failure (err, filename); | - | ||||||||||||||||||||||||||||||||||||
| 696 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 697 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 698 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 699 | } | - | ||||||||||||||||||||||||||||||||||||
| 700 | } | - | ||||||||||||||||||||||||||||||||||||
| 701 | static | - | ||||||||||||||||||||||||||||||||||||
| 702 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||||||||||||||
| 704 | elide_tail_lines_pipe (const char *filename, int fd, uintmax_t n_elide, | - | ||||||||||||||||||||||||||||||||||||
| 705 | off_t current_pos) | - | ||||||||||||||||||||||||||||||||||||
| 706 | { | - | ||||||||||||||||||||||||||||||||||||
| 707 | struct linebuffer | - | ||||||||||||||||||||||||||||||||||||
| 708 | { | - | ||||||||||||||||||||||||||||||||||||
| 709 | char buffer[ | - | ||||||||||||||||||||||||||||||||||||
| 710 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 711 | ]; | - | ||||||||||||||||||||||||||||||||||||
| 712 | size_t nbytes; | - | ||||||||||||||||||||||||||||||||||||
| 713 | size_t nlines; | - | ||||||||||||||||||||||||||||||||||||
| 714 | struct linebuffer *next; | - | ||||||||||||||||||||||||||||||||||||
| 715 | }; | - | ||||||||||||||||||||||||||||||||||||
| 716 | uintmax_t desired_pos = current_pos; | - | ||||||||||||||||||||||||||||||||||||
| 717 | typedef struct linebuffer LBUFFER; | - | ||||||||||||||||||||||||||||||||||||
| 718 | LBUFFER *first, *last, *tmp; | - | ||||||||||||||||||||||||||||||||||||
| 719 | size_t total_lines = 0; | - | ||||||||||||||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||||||||||||||
| 721 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 722 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 723 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 724 | ; | - | ||||||||||||||||||||||||||||||||||||
| 725 | size_t n_read; | - | ||||||||||||||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||||||||||||||
| 727 | first = last = xmalloc (sizeof (LBUFFER)); | - | ||||||||||||||||||||||||||||||||||||
| 728 | first->nbytes = first->nlines = 0; | - | ||||||||||||||||||||||||||||||||||||
| 729 | first->next = | - | ||||||||||||||||||||||||||||||||||||
| 730 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 731 | ; | - | ||||||||||||||||||||||||||||||||||||
| 732 | tmp = xmalloc (sizeof (LBUFFER)); | - | ||||||||||||||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||||||||||||||
| 734 | - | |||||||||||||||||||||||||||||||||||||
| 735 | - | |||||||||||||||||||||||||||||||||||||
| 736 | - | |||||||||||||||||||||||||||||||||||||
| 737 | while (1) | - | ||||||||||||||||||||||||||||||||||||
| 738 | { | - | ||||||||||||||||||||||||||||||||||||
| 739 | n_read = safe_read (fd, tmp->buffer, | - | ||||||||||||||||||||||||||||||||||||
| 740 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 741 | ); | - | ||||||||||||||||||||||||||||||||||||
| 742 | if (n_read == 0
| 0-976 | ||||||||||||||||||||||||||||||||||||
| 743 | break; executed 976 times by 1 test: break;Executed by:
| 976 | ||||||||||||||||||||||||||||||||||||
| 744 | - | |||||||||||||||||||||||||||||||||||||
| 745 | if (! n_elide
| 45-889 | ||||||||||||||||||||||||||||||||||||
| 746 | { | - | ||||||||||||||||||||||||||||||||||||
| 747 | desired_pos += n_read; | - | ||||||||||||||||||||||||||||||||||||
| 748 | xwrite_stdout (tmp->buffer, n_read); | - | ||||||||||||||||||||||||||||||||||||
| 749 | continue; executed 44 times by 1 test: continue;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||
| 750 | } | - | ||||||||||||||||||||||||||||||||||||
| 751 | - | |||||||||||||||||||||||||||||||||||||
| 752 | tmp->nbytes = n_read; | - | ||||||||||||||||||||||||||||||||||||
| 753 | tmp->nlines = 0; | - | ||||||||||||||||||||||||||||||||||||
| 754 | tmp->next = | - | ||||||||||||||||||||||||||||||||||||
| 755 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 756 | ; | - | ||||||||||||||||||||||||||||||||||||
| 757 | - | |||||||||||||||||||||||||||||||||||||
| 758 | - | |||||||||||||||||||||||||||||||||||||
| 759 | { | - | ||||||||||||||||||||||||||||||||||||
| 760 | char const *buffer_end = tmp->buffer + n_read; | - | ||||||||||||||||||||||||||||||||||||
| 761 | char const *p = tmp->buffer; | - | ||||||||||||||||||||||||||||||||||||
| 762 | while ((
| 889-17858 | ||||||||||||||||||||||||||||||||||||
| 763 | { | - | ||||||||||||||||||||||||||||||||||||
| 764 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 765 | ++tmp->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 766 | } executed 17858 times by 1 test: end of blockExecuted by:
| 17858 | ||||||||||||||||||||||||||||||||||||
| 767 | } | - | ||||||||||||||||||||||||||||||||||||
| 768 | total_lines += tmp->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||||||||||||||
| 772 | - | |||||||||||||||||||||||||||||||||||||
| 773 | if (tmp->nbytes + last->nbytes <
| 2-887 | ||||||||||||||||||||||||||||||||||||
| 774 | 8192
| 2-887 | ||||||||||||||||||||||||||||||||||||
| 775 | ) | - | ||||||||||||||||||||||||||||||||||||
| 776 | { | - | ||||||||||||||||||||||||||||||||||||
| 777 | memcpy (&last->buffer[last->nbytes], tmp->buffer, tmp->nbytes); | - | ||||||||||||||||||||||||||||||||||||
| 778 | last->nbytes += tmp->nbytes; | - | ||||||||||||||||||||||||||||||||||||
| 779 | last->nlines += tmp->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 780 | } executed 887 times by 1 test: end of blockExecuted by:
| 887 | ||||||||||||||||||||||||||||||||||||
| 781 | else | - | ||||||||||||||||||||||||||||||||||||
| 782 | { | - | ||||||||||||||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||||||||||||||
| 784 | - | |||||||||||||||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||||||||||||||
| 788 | last = last->next = tmp; | - | ||||||||||||||||||||||||||||||||||||
| 789 | if (n_elide < total_lines - first->nlines
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 790 | { | - | ||||||||||||||||||||||||||||||||||||
| 791 | desired_pos += first->nbytes; | - | ||||||||||||||||||||||||||||||||||||
| 792 | xwrite_stdout (first->buffer, first->nbytes); | - | ||||||||||||||||||||||||||||||||||||
| 793 | tmp = first; | - | ||||||||||||||||||||||||||||||||||||
| 794 | total_lines -= first->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 795 | first = first->next; | - | ||||||||||||||||||||||||||||||||||||
| 796 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 797 | else | - | ||||||||||||||||||||||||||||||||||||
| 798 | tmp = xmalloc (sizeof (LBUFFER)); never executed: tmp = xmalloc (sizeof (LBUFFER)); | 0 | ||||||||||||||||||||||||||||||||||||
| 799 | } | - | ||||||||||||||||||||||||||||||||||||
| 800 | } | - | ||||||||||||||||||||||||||||||||||||
| 801 | - | |||||||||||||||||||||||||||||||||||||
| 802 | free (tmp); | - | ||||||||||||||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||||||||||||||
| 804 | if (n_read == ((size_t) -1)
| 0-976 | ||||||||||||||||||||||||||||||||||||
| 805 | { | - | ||||||||||||||||||||||||||||||||||||
| 806 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 807 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 808 | , | - | ||||||||||||||||||||||||||||||||||||
| 809 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 810 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 811 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 812 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 813 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 814 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 815 | ; | - | ||||||||||||||||||||||||||||||||||||
| 816 | goto never executed: free_lbuffers;goto free_lbuffers;never executed: goto free_lbuffers; | 0 | ||||||||||||||||||||||||||||||||||||
| 817 | } | - | ||||||||||||||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||||||||
| 821 | if (last->nbytes
| 44-887 | ||||||||||||||||||||||||||||||||||||
| 822 | { | - | ||||||||||||||||||||||||||||||||||||
| 823 | ++last->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 824 | ++total_lines; | - | ||||||||||||||||||||||||||||||||||||
| 825 | } executed 44 times by 1 test: end of blockExecuted by:
| 44 | ||||||||||||||||||||||||||||||||||||
| 826 | - | |||||||||||||||||||||||||||||||||||||
| 827 | for (tmp = first; n_elide < total_lines - tmp->nlines
| 0-976 | ||||||||||||||||||||||||||||||||||||
| 828 | { | - | ||||||||||||||||||||||||||||||||||||
| 829 | desired_pos += tmp->nbytes; | - | ||||||||||||||||||||||||||||||||||||
| 830 | xwrite_stdout (tmp->buffer, tmp->nbytes); | - | ||||||||||||||||||||||||||||||||||||
| 831 | total_lines -= tmp->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 832 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||||||||||||||
| 835 | if (n_elide < total_lines
| 423-553 | ||||||||||||||||||||||||||||||||||||
| 836 | { | - | ||||||||||||||||||||||||||||||||||||
| 837 | size_t n = total_lines - n_elide; | - | ||||||||||||||||||||||||||||||||||||
| 838 | char const *buffer_end = tmp->buffer + tmp->nbytes; | - | ||||||||||||||||||||||||||||||||||||
| 839 | char const *p = tmp->buffer; | - | ||||||||||||||||||||||||||||||||||||
| 840 | while (n
| 0-3083 | ||||||||||||||||||||||||||||||||||||
| 841 | { | - | ||||||||||||||||||||||||||||||||||||
| 842 | ++p; | - | ||||||||||||||||||||||||||||||||||||
| 843 | ++tmp->nlines; | - | ||||||||||||||||||||||||||||||||||||
| 844 | --n; | - | ||||||||||||||||||||||||||||||||||||
| 845 | } executed 3083 times by 1 test: end of blockExecuted by:
| 3083 | ||||||||||||||||||||||||||||||||||||
| 846 | desired_pos += p - tmp->buffer; | - | ||||||||||||||||||||||||||||||||||||
| 847 | xwrite_stdout (tmp->buffer, p - tmp->buffer); | - | ||||||||||||||||||||||||||||||||||||
| 848 | } executed 423 times by 1 test: end of blockExecuted by:
| 423 | ||||||||||||||||||||||||||||||||||||
| 849 | - | |||||||||||||||||||||||||||||||||||||
| 850 | free_lbuffers: code before this statement executed 976 times by 1 test: free_lbuffers:Executed by:
| 976 | ||||||||||||||||||||||||||||||||||||
| 851 | while (first
| 976 | ||||||||||||||||||||||||||||||||||||
| 852 | { | - | ||||||||||||||||||||||||||||||||||||
| 853 | tmp = first->next; | - | ||||||||||||||||||||||||||||||||||||
| 854 | free (first); | - | ||||||||||||||||||||||||||||||||||||
| 855 | first = tmp; | - | ||||||||||||||||||||||||||||||||||||
| 856 | } executed 976 times by 1 test: end of blockExecuted by:
| 976 | ||||||||||||||||||||||||||||||||||||
| 857 | - | |||||||||||||||||||||||||||||||||||||
| 858 | if (0 <= current_pos
| 0-492 | ||||||||||||||||||||||||||||||||||||
| 859 | 0
| 0-492 | ||||||||||||||||||||||||||||||||||||
| 860 | , filename) < 0
| 0-492 | ||||||||||||||||||||||||||||||||||||
| 861 | ok = never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 862 | 0 never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 863 | ; never executed: ok = 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 864 | return executed 976 times by 1 test: ok;return ok;Executed by:
executed 976 times by 1 test: return ok;Executed by:
| 976 | ||||||||||||||||||||||||||||||||||||
| 865 | } | - | ||||||||||||||||||||||||||||||||||||
| 866 | static | - | ||||||||||||||||||||||||||||||||||||
| 867 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||||||||||||||
| 869 | elide_tail_lines_seekable (const char *pretty_filename, int fd, | - | ||||||||||||||||||||||||||||||||||||
| 870 | uintmax_t n_lines, | - | ||||||||||||||||||||||||||||||||||||
| 871 | off_t start_pos, off_t size) | - | ||||||||||||||||||||||||||||||||||||
| 872 | { | - | ||||||||||||||||||||||||||||||||||||
| 873 | char buffer[ | - | ||||||||||||||||||||||||||||||||||||
| 874 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 875 | ]; | - | ||||||||||||||||||||||||||||||||||||
| 876 | size_t bytes_read; | - | ||||||||||||||||||||||||||||||||||||
| 877 | off_t pos = size; | - | ||||||||||||||||||||||||||||||||||||
| 878 | - | |||||||||||||||||||||||||||||||||||||
| 879 | - | |||||||||||||||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||||||||||||||
| 881 | bytes_read = (pos - start_pos) % | - | ||||||||||||||||||||||||||||||||||||
| 882 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 883 | ; | - | ||||||||||||||||||||||||||||||||||||
| 884 | if (bytes_read == 0
| 1-2 | ||||||||||||||||||||||||||||||||||||
| 885 | bytes_read = executed 2 times by 1 test: bytes_read = 8192 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 886 | 8192 executed 2 times by 1 test: bytes_read = 8192 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 887 | ; executed 2 times by 1 test: bytes_read = 8192 ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||||||||||||||
| 890 | pos -= bytes_read; | - | ||||||||||||||||||||||||||||||||||||
| 891 | if (elseek (fd, pos,
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 892 | 0
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 893 | , pretty_filename) < 0
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 894 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 895 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 896 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 897 | bytes_read = safe_read (fd, buffer, bytes_read); | - | ||||||||||||||||||||||||||||||||||||
| 898 | if (bytes_read == ((size_t) -1)
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 899 | { | - | ||||||||||||||||||||||||||||||||||||
| 900 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 901 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 902 | , | - | ||||||||||||||||||||||||||||||||||||
| 903 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 904 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 905 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 906 | , quotearg_style (shell_escape_always_quoting_style, pretty_filename)); | - | ||||||||||||||||||||||||||||||||||||
| 907 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 908 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 909 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 910 | } | - | ||||||||||||||||||||||||||||||||||||
| 911 | - | |||||||||||||||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||||||||||||||
| 913 | const | - | ||||||||||||||||||||||||||||||||||||
| 914 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 915 | all_lines = !n_lines; | - | ||||||||||||||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||||||||||||||
| 918 | if (n_lines
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 919 | -- never executed: n_lines;--n_lines;never executed: --n_lines; | 0 | ||||||||||||||||||||||||||||||||||||
| 920 | - | |||||||||||||||||||||||||||||||||||||
| 921 | while (1) | - | ||||||||||||||||||||||||||||||||||||
| 922 | { | - | ||||||||||||||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||||||||||||||
| 925 | size_t n = bytes_read; | - | ||||||||||||||||||||||||||||||||||||
| 926 | while (n
| 0-50040 | ||||||||||||||||||||||||||||||||||||
| 927 | { | - | ||||||||||||||||||||||||||||||||||||
| 928 | if (all_lines
| 1-50039 | ||||||||||||||||||||||||||||||||||||
| 929 | n -= 1; executed 1 time by 1 test: n -= 1;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 930 | else | - | ||||||||||||||||||||||||||||||||||||
| 931 | { | - | ||||||||||||||||||||||||||||||||||||
| 932 | char const *nl; | - | ||||||||||||||||||||||||||||||||||||
| 933 | nl = memrchr (buffer, line_end, n); | - | ||||||||||||||||||||||||||||||||||||
| 934 | if (nl ==
| 36-50003 | ||||||||||||||||||||||||||||||||||||
| 935 | ((void *)0)
| 36-50003 | ||||||||||||||||||||||||||||||||||||
| 936 | ) | - | ||||||||||||||||||||||||||||||||||||
| 937 | break; executed 36 times by 1 test: break;Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 938 | n = nl - buffer; | - | ||||||||||||||||||||||||||||||||||||
| 939 | } executed 50003 times by 1 test: end of blockExecuted by:
| 50003 | ||||||||||||||||||||||||||||||||||||
| 940 | if (n_lines-- == 0
| 3-50001 | ||||||||||||||||||||||||||||||||||||
| 941 | { | - | ||||||||||||||||||||||||||||||||||||
| 942 | - | |||||||||||||||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||||||||||||||
| 944 | - | |||||||||||||||||||||||||||||||||||||
| 945 | if (start_pos < pos
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 946 | { | - | ||||||||||||||||||||||||||||||||||||
| 947 | enum Copy_fd_status err; | - | ||||||||||||||||||||||||||||||||||||
| 948 | if (elseek (fd, start_pos,
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 949 | 0
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 950 | , pretty_filename) < 0
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 951 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 952 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 953 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 954 | - | |||||||||||||||||||||||||||||||||||||
| 955 | err = copy_fd (fd, pos - start_pos); | - | ||||||||||||||||||||||||||||||||||||
| 956 | if (err != COPY_FD_OK
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 957 | { | - | ||||||||||||||||||||||||||||||||||||
| 958 | diagnose_copy_fd_failure (err, pretty_filename); | - | ||||||||||||||||||||||||||||||||||||
| 959 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 960 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 961 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 962 | } | - | ||||||||||||||||||||||||||||||||||||
| 963 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||||||||||||||
| 965 | - | |||||||||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||||||||
| 967 | xwrite_stdout (buffer, n + 1); | - | ||||||||||||||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||||||||||||||
| 970 | return executed 1 time by 1 test: 0 <= elseek (fd, pos + n + 1, return 0 <= elseek (fd, pos + n + 1, 0 , pretty_filename);Executed by:
executed 1 time by 1 test: return 0 <= elseek (fd, pos + n + 1, 0 , pretty_filename);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 971 | 0 executed 1 time by 1 test: return 0 <= elseek (fd, pos + n + 1, 0 , pretty_filename);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 972 | , pretty_filename); executed 1 time by 1 test: return 0 <= elseek (fd, pos + n + 1, 0 , pretty_filename);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 973 | } | - | ||||||||||||||||||||||||||||||||||||
| 974 | } executed 50001 times by 1 test: end of blockExecuted by:
| 50001 | ||||||||||||||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||||||||||||||
| 977 | if (pos == start_pos
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 978 | { | - | ||||||||||||||||||||||||||||||||||||
| 979 | - | |||||||||||||||||||||||||||||||||||||
| 980 | return never executed: return 1 ;never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 981 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 982 | ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 983 | } | - | ||||||||||||||||||||||||||||||||||||
| 984 | pos -= | - | ||||||||||||||||||||||||||||||||||||
| 985 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 986 | ; | - | ||||||||||||||||||||||||||||||||||||
| 987 | if (elseek (fd, pos,
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 988 | 0
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 989 | , pretty_filename) < 0
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 990 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 991 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 992 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 993 | - | |||||||||||||||||||||||||||||||||||||
| 994 | bytes_read = safe_read (fd, buffer, | - | ||||||||||||||||||||||||||||||||||||
| 995 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 996 | ); | - | ||||||||||||||||||||||||||||||||||||
| 997 | if (bytes_read == ((size_t) -1)
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 998 | { | - | ||||||||||||||||||||||||||||||||||||
| 999 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1000 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1001 | , | - | ||||||||||||||||||||||||||||||||||||
| 1002 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1003 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 1004 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1005 | , quotearg_style (shell_escape_always_quoting_style, pretty_filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1006 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1007 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1008 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1009 | } | - | ||||||||||||||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||||||||||||||
| 1011 | - | |||||||||||||||||||||||||||||||||||||
| 1012 | - | |||||||||||||||||||||||||||||||||||||
| 1013 | if (bytes_read == 0
| 0-36 | ||||||||||||||||||||||||||||||||||||
| 1014 | return never executed: return 1 ;never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1015 | 1 never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1016 | ; never executed: return 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1017 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1018 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||||||||||||||
| 1020 | - | |||||||||||||||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||||||||||||||
| 1022 | - | |||||||||||||||||||||||||||||||||||||
| 1023 | - | |||||||||||||||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||||||||||||||
| 1025 | static | - | ||||||||||||||||||||||||||||||||||||
| 1026 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||||||||
| 1028 | elide_tail_lines_file (const char *filename, int fd, uintmax_t n_elide, | - | ||||||||||||||||||||||||||||||||||||
| 1029 | struct stat const *st, off_t current_pos) | - | ||||||||||||||||||||||||||||||||||||
| 1030 | { | - | ||||||||||||||||||||||||||||||||||||
| 1031 | off_t size = st->st_size; | - | ||||||||||||||||||||||||||||||||||||
| 1032 | if (presume_input_pipe
| 0-497 | ||||||||||||||||||||||||||||||||||||
| 1033 | 512
| 3-492 | ||||||||||||||||||||||||||||||||||||
| 1034 | )
| 3-492 | ||||||||||||||||||||||||||||||||||||
| 1035 | return executed 978 times by 1 test: elide_tail_lines_pipe (filename, fd, n_elide, current_pos);return elide_tail_lines_pipe (filename, fd, n_elide, current_pos);Executed by:
executed 978 times by 1 test: return elide_tail_lines_pipe (filename, fd, n_elide, current_pos);Executed by:
| 978 | ||||||||||||||||||||||||||||||||||||
| 1036 | else | - | ||||||||||||||||||||||||||||||||||||
| 1037 | { | - | ||||||||||||||||||||||||||||||||||||
| 1038 | - | |||||||||||||||||||||||||||||||||||||
| 1039 | - | |||||||||||||||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||||||||||||||
| 1041 | - | |||||||||||||||||||||||||||||||||||||
| 1042 | - | |||||||||||||||||||||||||||||||||||||
| 1043 | return executed 3 times by 1 test: (size <= current_posreturn (size <= current_pos || elide_tail_lines_seekable (filename, fd, n_elide, current_pos, size));Executed by:
executed 3 times by 1 test: return (size <= current_pos || elide_tail_lines_seekable (filename, fd, n_elide, current_pos, size));Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1044 | || elide_tail_lines_seekable (filename, fd, n_elide, executed 3 times by 1 test: return (size <= current_pos || elide_tail_lines_seekable (filename, fd, n_elide, current_pos, size));Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1045 | current_pos, size)); executed 3 times by 1 test: return (size <= current_pos || elide_tail_lines_seekable (filename, fd, n_elide, current_pos, size));Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1046 | } | - | ||||||||||||||||||||||||||||||||||||
| 1047 | } | - | ||||||||||||||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||||||||||||||
| 1049 | static | - | ||||||||||||||||||||||||||||||||||||
| 1050 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||||||||
| 1052 | head_bytes (const char *filename, int fd, uintmax_t bytes_to_write) | - | ||||||||||||||||||||||||||||||||||||
| 1053 | { | - | ||||||||||||||||||||||||||||||||||||
| 1054 | char buffer[ | - | ||||||||||||||||||||||||||||||||||||
| 1055 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 1056 | ]; | - | ||||||||||||||||||||||||||||||||||||
| 1057 | size_t bytes_to_read = | - | ||||||||||||||||||||||||||||||||||||
| 1058 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 1059 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1060 | - | |||||||||||||||||||||||||||||||||||||
| 1061 | while (bytes_to_write
| 140-1577 | ||||||||||||||||||||||||||||||||||||
| 1062 | { | - | ||||||||||||||||||||||||||||||||||||
| 1063 | size_t bytes_read; | - | ||||||||||||||||||||||||||||||||||||
| 1064 | if (bytes_to_write < bytes_to_read
| 147-1430 | ||||||||||||||||||||||||||||||||||||
| 1065 | bytes_to_read = bytes_to_write; executed 147 times by 1 test: bytes_to_read = bytes_to_write;Executed by:
| 147 | ||||||||||||||||||||||||||||||||||||
| 1066 | bytes_read = safe_read (fd, buffer, bytes_to_read); | - | ||||||||||||||||||||||||||||||||||||
| 1067 | if (bytes_read == ((size_t) -1)
| 0-1577 | ||||||||||||||||||||||||||||||||||||
| 1068 | { | - | ||||||||||||||||||||||||||||||||||||
| 1069 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1070 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1071 | , | - | ||||||||||||||||||||||||||||||||||||
| 1072 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1073 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 1074 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1075 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1076 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1077 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1078 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1079 | } | - | ||||||||||||||||||||||||||||||||||||
| 1080 | if (bytes_read == 0
| 8-1569 | ||||||||||||||||||||||||||||||||||||
| 1081 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1082 | xwrite_stdout (buffer, bytes_read); | - | ||||||||||||||||||||||||||||||||||||
| 1083 | bytes_to_write -= bytes_read; | - | ||||||||||||||||||||||||||||||||||||
| 1084 | } executed 1569 times by 1 test: end of blockExecuted by:
| 1569 | ||||||||||||||||||||||||||||||||||||
| 1085 | return executed 148 times by 1 test: return 1 ;Executed by:
executed 148 times by 1 test: return 1 ;Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 1086 | 1 executed 148 times by 1 test: return 1 ;Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 1087 | ; executed 148 times by 1 test: return 1 ;Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 1088 | } | - | ||||||||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||||||||
| 1090 | static | - | ||||||||||||||||||||||||||||||||||||
| 1091 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||||||||
| 1093 | head_lines (const char *filename, int fd, uintmax_t lines_to_write) | - | ||||||||||||||||||||||||||||||||||||
| 1094 | { | - | ||||||||||||||||||||||||||||||||||||
| 1095 | char buffer[ | - | ||||||||||||||||||||||||||||||||||||
| 1096 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 1097 | ]; | - | ||||||||||||||||||||||||||||||||||||
| 1098 | - | |||||||||||||||||||||||||||||||||||||
| 1099 | while (lines_to_write
| 502-1225 | ||||||||||||||||||||||||||||||||||||
| 1100 | { | - | ||||||||||||||||||||||||||||||||||||
| 1101 | size_t bytes_read = safe_read (fd, buffer, | - | ||||||||||||||||||||||||||||||||||||
| 1102 | 8192 | - | ||||||||||||||||||||||||||||||||||||
| 1103 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1104 | size_t bytes_to_write = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1105 | - | |||||||||||||||||||||||||||||||||||||
| 1106 | if (bytes_read == ((size_t) -1)
| 0-1225 | ||||||||||||||||||||||||||||||||||||
| 1107 | { | - | ||||||||||||||||||||||||||||||||||||
| 1108 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1109 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1110 | , | - | ||||||||||||||||||||||||||||||||||||
| 1111 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1112 | "error reading %s" | - | ||||||||||||||||||||||||||||||||||||
| 1113 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1114 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1115 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1116 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1117 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1118 | } | - | ||||||||||||||||||||||||||||||||||||
| 1119 | if (bytes_read == 0
| 26-1199 | ||||||||||||||||||||||||||||||||||||
| 1120 | break; executed 26 times by 1 test: break;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 1121 | while (bytes_to_write < bytes_read
| 697-5611464 | ||||||||||||||||||||||||||||||||||||
| 1122 | if (buffer[bytes_to_write++] == line_end
| 502-2902429 | ||||||||||||||||||||||||||||||||||||
| 1123 | { | - | ||||||||||||||||||||||||||||||||||||
| 1124 | off_t n_bytes_past_EOL = bytes_read - bytes_to_write; | - | ||||||||||||||||||||||||||||||||||||
| 1125 | - | |||||||||||||||||||||||||||||||||||||
| 1126 | - | |||||||||||||||||||||||||||||||||||||
| 1127 | - | |||||||||||||||||||||||||||||||||||||
| 1128 | if (lseek (fd, -n_bytes_past_EOL,
| 44-458 | ||||||||||||||||||||||||||||||||||||
| 1129 | 1
| 44-458 | ||||||||||||||||||||||||||||||||||||
| 1130 | ) < 0
| 44-458 | ||||||||||||||||||||||||||||||||||||
| 1131 | { | - | ||||||||||||||||||||||||||||||||||||
| 1132 | struct stat st; | - | ||||||||||||||||||||||||||||||||||||
| 1133 | if (fstat (fd, &st) != 0
| 0-44 | ||||||||||||||||||||||||||||||||||||
| 1134 | ((((
| 0-44 | ||||||||||||||||||||||||||||||||||||
| 1135 | st.st_mode
| 0-44 | ||||||||||||||||||||||||||||||||||||
| 1136 | )) & 0170000) == (0100000))
| 0-44 | ||||||||||||||||||||||||||||||||||||
| 1137 | ) | - | ||||||||||||||||||||||||||||||||||||
| 1138 | elseek (fd, -n_bytes_past_EOL, never executed: elseek (fd, -n_bytes_past_EOL, 1 , filename); | 0 | ||||||||||||||||||||||||||||||||||||
| 1139 | 1 never executed: elseek (fd, -n_bytes_past_EOL, 1 , filename); | 0 | ||||||||||||||||||||||||||||||||||||
| 1140 | , filename); never executed: elseek (fd, -n_bytes_past_EOL, 1 , filename); | 0 | ||||||||||||||||||||||||||||||||||||
| 1141 | } executed 44 times by 1 test: end of blockExecuted by:
| 44 | ||||||||||||||||||||||||||||||||||||
| 1142 | break; executed 502 times by 1 test: break;Executed by:
| 502 | ||||||||||||||||||||||||||||||||||||
| 1143 | } | - | ||||||||||||||||||||||||||||||||||||
| 1144 | xwrite_stdout (buffer, bytes_to_write); | - | ||||||||||||||||||||||||||||||||||||
| 1145 | } executed 1199 times by 1 test: end of blockExecuted by:
| 1199 | ||||||||||||||||||||||||||||||||||||
| 1146 | return executed 528 times by 1 test: return 1 ;Executed by:
executed 528 times by 1 test: return 1 ;Executed by:
| 528 | ||||||||||||||||||||||||||||||||||||
| 1147 | 1 executed 528 times by 1 test: return 1 ;Executed by:
| 528 | ||||||||||||||||||||||||||||||||||||
| 1148 | ; executed 528 times by 1 test: return 1 ;Executed by:
| 528 | ||||||||||||||||||||||||||||||||||||
| 1149 | } | - | ||||||||||||||||||||||||||||||||||||
| 1150 | - | |||||||||||||||||||||||||||||||||||||
| 1151 | static | - | ||||||||||||||||||||||||||||||||||||
| 1152 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||||||||||||||
| 1154 | head (const char *filename, int fd, uintmax_t n_units, | - | ||||||||||||||||||||||||||||||||||||
| 1155 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1156 | count_lines, | - | ||||||||||||||||||||||||||||||||||||
| 1157 | - | |||||||||||||||||||||||||||||||||||||
| 1158 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1159 | elide_from_end) | - | ||||||||||||||||||||||||||||||||||||
| 1160 | { | - | ||||||||||||||||||||||||||||||||||||
| 1161 | if (print_headers
| 0-2616 | ||||||||||||||||||||||||||||||||||||
| 1162 | write_header (filename); never executed: write_header (filename); | 0 | ||||||||||||||||||||||||||||||||||||
| 1163 | - | |||||||||||||||||||||||||||||||||||||
| 1164 | if (elide_from_end
| 676-1940 | ||||||||||||||||||||||||||||||||||||
| 1165 | { | - | ||||||||||||||||||||||||||||||||||||
| 1166 | off_t current_pos = -1; | - | ||||||||||||||||||||||||||||||||||||
| 1167 | struct stat st; | - | ||||||||||||||||||||||||||||||||||||
| 1168 | if (fstat (fd, &st) != 0
| 0-1940 | ||||||||||||||||||||||||||||||||||||
| 1169 | { | - | ||||||||||||||||||||||||||||||||||||
| 1170 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1171 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1172 | , | - | ||||||||||||||||||||||||||||||||||||
| 1173 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1174 | "cannot fstat %s" | - | ||||||||||||||||||||||||||||||||||||
| 1175 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1176 | , | - | ||||||||||||||||||||||||||||||||||||
| 1177 | quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1178 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1179 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1180 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1181 | } | - | ||||||||||||||||||||||||||||||||||||
| 1182 | if (! presume_input_pipe
| 7-1015 | ||||||||||||||||||||||||||||||||||||
| 1183 | { | - | ||||||||||||||||||||||||||||||||||||
| 1184 | current_pos = elseek (fd, 0, | - | ||||||||||||||||||||||||||||||||||||
| 1185 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1186 | , filename); | - | ||||||||||||||||||||||||||||||||||||
| 1187 | if (current_pos < 0
| 0-1008 | ||||||||||||||||||||||||||||||||||||
| 1188 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1189 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1190 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1191 | } executed 1008 times by 1 test: end of blockExecuted by:
| 1008 | ||||||||||||||||||||||||||||||||||||
| 1192 | if (count_lines
| 959-981 | ||||||||||||||||||||||||||||||||||||
| 1193 | return executed 981 times by 1 test: elide_tail_lines_file (filename, fd, n_units, &st, current_pos);return elide_tail_lines_file (filename, fd, n_units, &st, current_pos);Executed by:
executed 981 times by 1 test: return elide_tail_lines_file (filename, fd, n_units, &st, current_pos);Executed by:
| 981 | ||||||||||||||||||||||||||||||||||||
| 1194 | else | - | ||||||||||||||||||||||||||||||||||||
| 1195 | return executed 959 times by 1 test: elide_tail_bytes_file (filename, fd, n_units, &st, current_pos);return elide_tail_bytes_file (filename, fd, n_units, &st, current_pos);Executed by:
executed 959 times by 1 test: return elide_tail_bytes_file (filename, fd, n_units, &st, current_pos);Executed by:
| 959 | ||||||||||||||||||||||||||||||||||||
| 1196 | } | - | ||||||||||||||||||||||||||||||||||||
| 1197 | if (count_lines
| 148-528 | ||||||||||||||||||||||||||||||||||||
| 1198 | return executed 528 times by 1 test: head_lines (filename, fd, n_units);return head_lines (filename, fd, n_units);Executed by:
executed 528 times by 1 test: return head_lines (filename, fd, n_units);Executed by:
| 528 | ||||||||||||||||||||||||||||||||||||
| 1199 | else | - | ||||||||||||||||||||||||||||||||||||
| 1200 | return executed 148 times by 1 test: head_bytes (filename, fd, n_units);return head_bytes (filename, fd, n_units);Executed by:
executed 148 times by 1 test: return head_bytes (filename, fd, n_units);Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 1201 | } | - | ||||||||||||||||||||||||||||||||||||
| 1202 | - | |||||||||||||||||||||||||||||||||||||
| 1203 | static | - | ||||||||||||||||||||||||||||||||||||
| 1204 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1205 | - | |||||||||||||||||||||||||||||||||||||
| 1206 | head_file (const char *filename, uintmax_t n_units, | - | ||||||||||||||||||||||||||||||||||||
| 1207 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1208 | count_lines, | - | ||||||||||||||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||||||||||||||
| 1210 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1211 | elide_from_end) | - | ||||||||||||||||||||||||||||||||||||
| 1212 | { | - | ||||||||||||||||||||||||||||||||||||
| 1213 | int fd; | - | ||||||||||||||||||||||||||||||||||||
| 1214 | - | |||||||||||||||||||||||||||||||||||||
| 1215 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1216 | ok; | - | ||||||||||||||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||||||||||||||
| 1218 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1219 | is_stdin = ( | - | ||||||||||||||||||||||||||||||||||||
| 1220 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( | - | ||||||||||||||||||||||||||||||||||||
| 1221 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1222 | ) && __builtin_constant_p ( | - | ||||||||||||||||||||||||||||||||||||
| 1223 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1224 | ) && (__s1_len = __builtin_strlen ( | - | ||||||||||||||||||||||||||||||||||||
| 1225 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1226 | ), __s2_len = __builtin_strlen ( | - | ||||||||||||||||||||||||||||||||||||
| 1227 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1228 | ), (!((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1229 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1230 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1231 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1232 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1233 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1234 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1235 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1236 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp ( | - | ||||||||||||||||||||||||||||||||||||
| 1237 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1238 | , | - | ||||||||||||||||||||||||||||||||||||
| 1239 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1240 | ) : (__builtin_constant_p ( | - | ||||||||||||||||||||||||||||||||||||
| 1241 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1242 | ) && ((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1243 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1244 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1245 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1246 | ) == 1) && (__s1_len = __builtin_strlen ( | - | ||||||||||||||||||||||||||||||||||||
| 1247 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1248 | ), __s1_len < 4) ? (__builtin_constant_p ( | - | ||||||||||||||||||||||||||||||||||||
| 1249 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1250 | ) && ((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1251 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1252 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1253 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1254 | ) == 1) ? __builtin_strcmp ( | - | ||||||||||||||||||||||||||||||||||||
| 1255 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1256 | , | - | ||||||||||||||||||||||||||||||||||||
| 1257 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1258 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( | - | ||||||||||||||||||||||||||||||||||||
| 1259 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1260 | ); int __result = (((const unsigned char *) (const char *) ( | - | ||||||||||||||||||||||||||||||||||||
| 1261 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1262 | ))[0] - __s2[0]); if (__s1_len > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 1263 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1264 | ))[1] - __s2[1]); if (__s1_len > 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 1265 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1266 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( filename ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 1267 | filename never executed: __result = (((const unsigned char *) (const char *) ( filename ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 1268 | ))[3] - __s2[3]); never executed: }__result = (((const unsigned char *) (const char *) ( filename ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1269 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1270 | ) && ((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1271 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1272 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1273 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1274 | ) == 1) && (__s2_len = __builtin_strlen ( | - | ||||||||||||||||||||||||||||||||||||
| 1275 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1276 | ), __s2_len < 4) ? (__builtin_constant_p ( | - | ||||||||||||||||||||||||||||||||||||
| 1277 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1278 | ) && ((size_t)(const void *)(( | - | ||||||||||||||||||||||||||||||||||||
| 1279 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1280 | ) + 1) - (size_t)(const void *)( | - | ||||||||||||||||||||||||||||||||||||
| 1281 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1282 | ) == 1) ? __builtin_strcmp ( | - | ||||||||||||||||||||||||||||||||||||
| 1283 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1284 | , | - | ||||||||||||||||||||||||||||||||||||
| 1285 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1286 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( | - | ||||||||||||||||||||||||||||||||||||
| 1287 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1288 | ); int __result = (((const unsigned char *) (const char *) ( | - | ||||||||||||||||||||||||||||||||||||
| 1289 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1290 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-2616 | ||||||||||||||||||||||||||||||||||||
| 1291 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1292 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-276 | ||||||||||||||||||||||||||||||||||||
| 1293 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1294 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 1295 | "-" never executed: __result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 1296 | ))[3] - __s2[3]); never executed: }__result = (((const unsigned char *) (const char *) ( "-" ))[3] - __s2[3]);never executed: }end of blockexecuted 276 times by 1 test: __result; }))) : __builtin_strcmp (end of blockExecuted by:
| 0-276 | ||||||||||||||||||||||||||||||||||||
| 1297 | filename | - | ||||||||||||||||||||||||||||||||||||
| 1298 | , | - | ||||||||||||||||||||||||||||||||||||
| 1299 | "-" | - | ||||||||||||||||||||||||||||||||||||
| 1300 | )))); }) | - | ||||||||||||||||||||||||||||||||||||
| 1301 | == 0); | - | ||||||||||||||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||||||||||||||
| 1303 | if (is_stdin
| 276-2340 | ||||||||||||||||||||||||||||||||||||
| 1304 | { | - | ||||||||||||||||||||||||||||||||||||
| 1305 | have_read_stdin = | - | ||||||||||||||||||||||||||||||||||||
| 1306 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1307 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1308 | fd = | - | ||||||||||||||||||||||||||||||||||||
| 1309 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1310 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1311 | filename = | - | ||||||||||||||||||||||||||||||||||||
| 1312 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1313 | "standard input" | - | ||||||||||||||||||||||||||||||||||||
| 1314 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1315 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1316 | xset_binary_mode ( | - | ||||||||||||||||||||||||||||||||||||
| 1317 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1318 | , | - | ||||||||||||||||||||||||||||||||||||
| 1319 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1320 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1321 | } executed 276 times by 1 test: end of blockExecuted by:
| 276 | ||||||||||||||||||||||||||||||||||||
| 1322 | else | - | ||||||||||||||||||||||||||||||||||||
| 1323 | { | - | ||||||||||||||||||||||||||||||||||||
| 1324 | fd = open (filename, | - | ||||||||||||||||||||||||||||||||||||
| 1325 | 00 | - | ||||||||||||||||||||||||||||||||||||
| 1326 | | | - | ||||||||||||||||||||||||||||||||||||
| 1327 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1328 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1329 | if (fd < 0
| 0-2340 | ||||||||||||||||||||||||||||||||||||
| 1330 | { | - | ||||||||||||||||||||||||||||||||||||
| 1331 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1332 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1333 | , | - | ||||||||||||||||||||||||||||||||||||
| 1334 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1335 | "cannot open %s for reading" | - | ||||||||||||||||||||||||||||||||||||
| 1336 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1337 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1338 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1339 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1340 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1341 | } | - | ||||||||||||||||||||||||||||||||||||
| 1342 | } executed 2340 times by 1 test: end of blockExecuted by:
| 2340 | ||||||||||||||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||||||||||||||
| 1344 | ok = head (filename, fd, n_units, count_lines, elide_from_end); | - | ||||||||||||||||||||||||||||||||||||
| 1345 | if (!is_stdin
| 0-2336 | ||||||||||||||||||||||||||||||||||||
| 1346 | { | - | ||||||||||||||||||||||||||||||||||||
| 1347 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 1348 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 1349 | , | - | ||||||||||||||||||||||||||||||||||||
| 1350 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1351 | "failed to close %s" | - | ||||||||||||||||||||||||||||||||||||
| 1352 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1353 | , quotearg_style (shell_escape_always_quoting_style, filename)); | - | ||||||||||||||||||||||||||||||||||||
| 1354 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1355 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1356 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1357 | } | - | ||||||||||||||||||||||||||||||||||||
| 1358 | return executed 2608 times by 1 test: ok;return ok;Executed by:
executed 2608 times by 1 test: return ok;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1359 | } | - | ||||||||||||||||||||||||||||||||||||
| 1360 | - | |||||||||||||||||||||||||||||||||||||
| 1361 | - | |||||||||||||||||||||||||||||||||||||
| 1362 | - | |||||||||||||||||||||||||||||||||||||
| 1363 | - | |||||||||||||||||||||||||||||||||||||
| 1364 | - | |||||||||||||||||||||||||||||||||||||
| 1365 | - | |||||||||||||||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||||||||||||||
| 1367 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||
| 1368 | string_to_integer ( | - | ||||||||||||||||||||||||||||||||||||
| 1369 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1370 | count_lines, const char *n_string) | - | ||||||||||||||||||||||||||||||||||||
| 1371 | { | - | ||||||||||||||||||||||||||||||||||||
| 1372 | return executed 2594 times by 1 test: xdectoumax (n_string, 0, return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1373 | (18446744073709551615UL) executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1374 | , "bkKmMGTPEZY0", executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1375 | count_lines ? executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1376 | dcgettext (((void *)0), executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1377 | "invalid number of lines" executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1378 | , 5) executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1379 | executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1380 | : executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1381 | dcgettext (((void *)0), executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1382 | "invalid number of bytes" executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1383 | , 5) executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1384 | , 0); executed 2594 times by 1 test: return xdectoumax (n_string, 0, (18446744073709551615UL) , "bkKmMGTPEZY0", count_lines ? dcgettext (((void *)0), "invalid number of lines" , 5) : dcgettext (((void *)0), "invalid number of bytes" , 5) , 0);Executed by:
| 2594 | ||||||||||||||||||||||||||||||||||||
| 1385 | } | - | ||||||||||||||||||||||||||||||||||||
| 1386 | - | |||||||||||||||||||||||||||||||||||||
| 1387 | int | - | ||||||||||||||||||||||||||||||||||||
| 1388 | main (int argc, char **argv) | - | ||||||||||||||||||||||||||||||||||||
| 1389 | { | - | ||||||||||||||||||||||||||||||||||||
| 1390 | enum header_mode header_mode = multiple_files; | - | ||||||||||||||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||||||||||||||
| 1392 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1393 | ok = | - | ||||||||||||||||||||||||||||||||||||
| 1394 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1395 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1396 | int c; | - | ||||||||||||||||||||||||||||||||||||
| 1397 | size_t i; | - | ||||||||||||||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||||||||||||||
| 1399 | - | |||||||||||||||||||||||||||||||||||||
| 1400 | uintmax_t n_units = 10; | - | ||||||||||||||||||||||||||||||||||||
| 1401 | - | |||||||||||||||||||||||||||||||||||||
| 1402 | - | |||||||||||||||||||||||||||||||||||||
| 1403 | - | |||||||||||||||||||||||||||||||||||||
| 1404 | - | |||||||||||||||||||||||||||||||||||||
| 1405 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1406 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1407 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1408 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1409 | - | |||||||||||||||||||||||||||||||||||||
| 1410 | - | |||||||||||||||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||||||||||||||
| 1412 | - | |||||||||||||||||||||||||||||||||||||
| 1413 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 1414 | elide_from_end = | - | ||||||||||||||||||||||||||||||||||||
| 1415 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1416 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||||||||||||||
| 1419 | - | |||||||||||||||||||||||||||||||||||||
| 1420 | static char const *const default_file_list[] = {"-", | - | ||||||||||||||||||||||||||||||||||||
| 1421 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 1422 | }; | - | ||||||||||||||||||||||||||||||||||||
| 1423 | char const *const *file_list; | - | ||||||||||||||||||||||||||||||||||||
| 1424 | - | |||||||||||||||||||||||||||||||||||||
| 1425 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1426 | set_program_name (argv[0]); | - | ||||||||||||||||||||||||||||||||||||
| 1427 | setlocale ( | - | ||||||||||||||||||||||||||||||||||||
| 1428 | 6 | - | ||||||||||||||||||||||||||||||||||||
| 1429 | , ""); | - | ||||||||||||||||||||||||||||||||||||
| 1430 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||||||||||||||||||||||||||
| 1431 | textdomain ("coreutils"); | - | ||||||||||||||||||||||||||||||||||||
| 1432 | - | |||||||||||||||||||||||||||||||||||||
| 1433 | atexit (close_stdout); | - | ||||||||||||||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||||||||||||||
| 1435 | have_read_stdin = | - | ||||||||||||||||||||||||||||||||||||
| 1436 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1437 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||||||||||||||
| 1439 | print_headers = | - | ||||||||||||||||||||||||||||||||||||
| 1440 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1441 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||||||||||||||
| 1443 | line_end = '\n'; | - | ||||||||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||||||||
| 1445 | if (1 < argc
| 8-2623 | ||||||||||||||||||||||||||||||||||||
| 1446 | { | - | ||||||||||||||||||||||||||||||||||||
| 1447 | char *a = argv[1]; | - | ||||||||||||||||||||||||||||||||||||
| 1448 | char *n_string = ++a; | - | ||||||||||||||||||||||||||||||||||||
| 1449 | char *end_n_string; | - | ||||||||||||||||||||||||||||||||||||
| 1450 | char multiplier_char = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||||||||||||||
| 1452 | - | |||||||||||||||||||||||||||||||||||||
| 1453 | - | |||||||||||||||||||||||||||||||||||||
| 1454 | do ++ executed 36 times by 1 test: a;++a;Executed by:
executed 36 times by 1 test: ++a;Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 1455 | while (((
| 12-24 | ||||||||||||||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||||||||||||||
| 1457 | - | |||||||||||||||||||||||||||||||||||||
| 1458 | end_n_string = a; | - | ||||||||||||||||||||||||||||||||||||
| 1459 | - | |||||||||||||||||||||||||||||||||||||
| 1460 | - | |||||||||||||||||||||||||||||||||||||
| 1461 | for (; *
| 15-24 | ||||||||||||||||||||||||||||||||||||
| 1462 | { | - | ||||||||||||||||||||||||||||||||||||
| 1463 | switch (*a) | - | ||||||||||||||||||||||||||||||||||||
| 1464 | { | - | ||||||||||||||||||||||||||||||||||||
| 1465 | case executed 9 times by 1 test: 'c':case 'c':Executed by:
executed 9 times by 1 test: case 'c':Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||
| 1466 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1467 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1468 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1469 | multiplier_char = 0; | - | ||||||||||||||||||||||||||||||||||||
| 1470 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||||||||||||||
| 1472 | case executed 3 times by 1 test: 'b':case 'b':Executed by:
executed 3 times by 1 test: case 'b':Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1473 | case executed 3 times by 1 test: 'k':case 'k':Executed by:
executed 3 times by 1 test: case 'k':Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1474 | case never executed: 'm':case 'm':never executed: case 'm': | 0 | ||||||||||||||||||||||||||||||||||||
| 1475 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1476 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1477 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1478 | multiplier_char = *a; | - | ||||||||||||||||||||||||||||||||||||
| 1479 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1480 | - | |||||||||||||||||||||||||||||||||||||
| 1481 | case never executed: 'l':case 'l':never executed: case 'l': | 0 | ||||||||||||||||||||||||||||||||||||
| 1482 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1483 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1484 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1485 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1486 | - | |||||||||||||||||||||||||||||||||||||
| 1487 | case never executed: 'q':case 'q':never executed: case 'q': | 0 | ||||||||||||||||||||||||||||||||||||
| 1488 | header_mode = never; | - | ||||||||||||||||||||||||||||||||||||
| 1489 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1490 | - | |||||||||||||||||||||||||||||||||||||
| 1491 | case never executed: 'v':case 'v':never executed: case 'v': | 0 | ||||||||||||||||||||||||||||||||||||
| 1492 | header_mode = always; | - | ||||||||||||||||||||||||||||||||||||
| 1493 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1494 | - | |||||||||||||||||||||||||||||||||||||
| 1495 | case never executed: 'z':case 'z':never executed: case 'z': | 0 | ||||||||||||||||||||||||||||||||||||
| 1496 | line_end = '\0'; | - | ||||||||||||||||||||||||||||||||||||
| 1497 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1498 | - | |||||||||||||||||||||||||||||||||||||
| 1499 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 1500 | error (0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 1501 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1502 | "invalid trailing option -- %c" | - | ||||||||||||||||||||||||||||||||||||
| 1503 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1504 | , *a); | - | ||||||||||||||||||||||||||||||||||||
| 1505 | usage ( | - | ||||||||||||||||||||||||||||||||||||
| 1506 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1507 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1508 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1509 | } | - | ||||||||||||||||||||||||||||||||||||
| 1510 | - | |||||||||||||||||||||||||||||||||||||
| 1511 | - | |||||||||||||||||||||||||||||||||||||
| 1512 | - | |||||||||||||||||||||||||||||||||||||
| 1513 | *end_n_string = multiplier_char; | - | ||||||||||||||||||||||||||||||||||||
| 1514 | if (multiplier_char
| 6-18 | ||||||||||||||||||||||||||||||||||||
| 1515 | *(++ executed 6 times by 1 test: end_n_string) = 0;*(++end_n_string) = 0;Executed by:
executed 6 times by 1 test: *(++end_n_string) = 0;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||||||||||||||
| 1517 | n_units = string_to_integer (count_lines, n_string); | - | ||||||||||||||||||||||||||||||||||||
| 1518 | - | |||||||||||||||||||||||||||||||||||||
| 1519 | - | |||||||||||||||||||||||||||||||||||||
| 1520 | argv[1] = argv[0]; | - | ||||||||||||||||||||||||||||||||||||
| 1521 | argv++; | - | ||||||||||||||||||||||||||||||||||||
| 1522 | argc--; | - | ||||||||||||||||||||||||||||||||||||
| 1523 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 1524 | - | |||||||||||||||||||||||||||||||||||||
| 1525 | while ((
| 2616-3529 | ||||||||||||||||||||||||||||||||||||
| 1526 | ((void *)0)
| 2616-3529 | ||||||||||||||||||||||||||||||||||||
| 1527 | ))
| 2616-3529 | ||||||||||||||||||||||||||||||||||||
| 1528 | != -1
| 2616-3529 | ||||||||||||||||||||||||||||||||||||
| 1529 | { | - | ||||||||||||||||||||||||||||||||||||
| 1530 | switch (c) | - | ||||||||||||||||||||||||||||||||||||
| 1531 | { | - | ||||||||||||||||||||||||||||||||||||
| 1532 | case executed 925 times by 1 test: PRESUME_INPUT_PIPE_OPTION:case PRESUME_INPUT_PIPE_OPTION:Executed by:
executed 925 times by 1 test: case PRESUME_INPUT_PIPE_OPTION:Executed by:
| 925 | ||||||||||||||||||||||||||||||||||||
| 1533 | presume_input_pipe = | - | ||||||||||||||||||||||||||||||||||||
| 1534 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1535 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1536 | break; executed 925 times by 1 test: break;Executed by:
| 925 | ||||||||||||||||||||||||||||||||||||
| 1537 | - | |||||||||||||||||||||||||||||||||||||
| 1538 | case executed 1094 times by 1 test: 'c':case 'c':Executed by:
executed 1094 times by 1 test: case 'c':Executed by:
| 1094 | ||||||||||||||||||||||||||||||||||||
| 1539 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1540 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1541 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1542 | elide_from_end = (*optarg == '-'); | - | ||||||||||||||||||||||||||||||||||||
| 1543 | if (elide_from_end
| 133-961 | ||||||||||||||||||||||||||||||||||||
| 1544 | ++ executed 961 times by 1 test: optarg;++optarg;Executed by:
executed 961 times by 1 test: ++optarg;Executed by:
| 961 | ||||||||||||||||||||||||||||||||||||
| 1545 | n_units = string_to_integer (count_lines, optarg); | - | ||||||||||||||||||||||||||||||||||||
| 1546 | break; executed 1092 times by 1 test: break;Executed by:
| 1092 | ||||||||||||||||||||||||||||||||||||
| 1547 | - | |||||||||||||||||||||||||||||||||||||
| 1548 | case executed 1476 times by 1 test: 'n':case 'n':Executed by:
executed 1476 times by 1 test: case 'n':Executed by:
| 1476 | ||||||||||||||||||||||||||||||||||||
| 1549 | count_lines = | - | ||||||||||||||||||||||||||||||||||||
| 1550 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1551 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1552 | elide_from_end = (*optarg == '-'); | - | ||||||||||||||||||||||||||||||||||||
| 1553 | if (elide_from_end
| 493-983 | ||||||||||||||||||||||||||||||||||||
| 1554 | ++ executed 983 times by 1 test: optarg;++optarg;Executed by:
executed 983 times by 1 test: ++optarg;Executed by:
| 983 | ||||||||||||||||||||||||||||||||||||
| 1555 | n_units = string_to_integer (count_lines, optarg); | - | ||||||||||||||||||||||||||||||||||||
| 1556 | break; executed 1474 times by 1 test: break;Executed by:
| 1474 | ||||||||||||||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||||||||||||||
| 1558 | case executed 3 times by 1 test: 'q':case 'q':Executed by:
executed 3 times by 1 test: case 'q':Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1559 | header_mode = never; | - | ||||||||||||||||||||||||||||||||||||
| 1560 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1561 | - | |||||||||||||||||||||||||||||||||||||
| 1562 | case executed 2 times by 1 test: 'v':case 'v':Executed by:
executed 2 times by 1 test: case 'v':Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1563 | header_mode = always; | - | ||||||||||||||||||||||||||||||||||||
| 1564 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 1565 | - | |||||||||||||||||||||||||||||||||||||
| 1566 | case executed 8 times by 1 test: 'z':case 'z':Executed by:
executed 8 times by 1 test: case 'z':Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1567 | line_end = '\0'; | - | ||||||||||||||||||||||||||||||||||||
| 1568 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1569 | - | |||||||||||||||||||||||||||||||||||||
| 1570 | case executed 10 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 10 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 1571 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1572 | ); break; never executed: ;break; | 0 | ||||||||||||||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||||||||||||||
| 1574 | case executed 8 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR:Executed by:
executed 8 times by 1 test: version_etc (case GETOPT_VERSION_CHAR:Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1575 | stdout | - | ||||||||||||||||||||||||||||||||||||
| 1576 | , "head", "GNU coreutils", Version, ("David MacKenzie"), ("Jim Meyering"), (char *) | - | ||||||||||||||||||||||||||||||||||||
| 1577 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 1578 | ); exit ( executed 8 times by 1 test: exit ( 0 );Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1579 | 0 executed 8 times by 1 test: exit ( 0 );Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 1580 | ); executed 8 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-8 | ||||||||||||||||||||||||||||||||||||
| 1581 | - | |||||||||||||||||||||||||||||||||||||
| 1582 | default executed 3 times by 1 test: :default:Executed by:
executed 3 times by 1 test: default:Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||
| 1583 | if (((
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 1584 | error (0, 0, never executed: error (0, 0, dcgettext (((void *)0), "invalid trailing option -- %c" , 5) , c); | 0 | ||||||||||||||||||||||||||||||||||||
| 1585 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "invalid trailing option -- %c" , 5) , c); | 0 | ||||||||||||||||||||||||||||||||||||
| 1586 | "invalid trailing option -- %c" never executed: error (0, 0, dcgettext (((void *)0), "invalid trailing option -- %c" , 5) , c); | 0 | ||||||||||||||||||||||||||||||||||||
| 1587 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "invalid trailing option -- %c" , 5) , c); | 0 | ||||||||||||||||||||||||||||||||||||
| 1588 | , c); never executed: error (0, 0, dcgettext (((void *)0), "invalid trailing option -- %c" , 5) , c); | 0 | ||||||||||||||||||||||||||||||||||||
| 1589 | usage ( | - | ||||||||||||||||||||||||||||||||||||
| 1590 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1591 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1592 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1593 | } | - | ||||||||||||||||||||||||||||||||||||
| 1594 | - | |||||||||||||||||||||||||||||||||||||
| 1595 | if (header_mode == always
| 0-2616 | ||||||||||||||||||||||||||||||||||||
| 1596 | || (header_mode == multiple_files
| 0-2616 | ||||||||||||||||||||||||||||||||||||
| 1597 | print_headers = never executed: print_headers = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1598 | 1 never executed: print_headers = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1599 | ; never executed: print_headers = 1 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 1600 | - | |||||||||||||||||||||||||||||||||||||
| 1601 | if ( ! count_lines
| 0-1509 | ||||||||||||||||||||||||||||||||||||
| 1602 | { | - | ||||||||||||||||||||||||||||||||||||
| 1603 | char umax_buf[((((((sizeof (n_units) * 8) - (! ((__typeof__ (n_units)) 0 < (__typeof__ (n_units)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (n_units)) 0 < (__typeof__ (n_units)) -1))) + 1)]; | - | ||||||||||||||||||||||||||||||||||||
| 1604 | ((!!sizeof (struct { _Static_assert ( | - | ||||||||||||||||||||||||||||||||||||
| 1605 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1606 | , "verify_expr (" "1" ", " "(error (1, 75, \"%s: %s\", dcgettext (((void *)0), \"invalid number of bytes\", 5), quote (umaxtostr (n_units, umax_buf))), assume (false))" ")"); int _gl_dummy; })) ? ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 1607 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1608 | , | - | ||||||||||||||||||||||||||||||||||||
| 1609 | 75 | - | ||||||||||||||||||||||||||||||||||||
| 1610 | , "%s: %s", | - | ||||||||||||||||||||||||||||||||||||
| 1611 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1612 | "invalid number of bytes" | - | ||||||||||||||||||||||||||||||||||||
| 1613 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1614 | , quote (umaxtostr (n_units, umax_buf))), (( | - | ||||||||||||||||||||||||||||||||||||
| 1615 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1616 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( | - | ||||||||||||||||||||||||||||||||||||
| 1617 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1618 | , | - | ||||||||||||||||||||||||||||||||||||
| 1619 | 75 | - | ||||||||||||||||||||||||||||||||||||
| 1620 | , "%s: %s", | - | ||||||||||||||||||||||||||||||||||||
| 1621 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 1622 | "invalid number of bytes" | - | ||||||||||||||||||||||||||||||||||||
| 1623 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 1624 | , quote (umaxtostr (n_units, umax_buf))), (( | - | ||||||||||||||||||||||||||||||||||||
| 1625 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1626 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||||||||||||||||||||||||||
| 1627 | ; | - | ||||||||||||||||||||||||||||||||||||
| 1628 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 1629 | - | |||||||||||||||||||||||||||||||||||||
| 1630 | file_list = (optind < argc
| 276-2340 | ||||||||||||||||||||||||||||||||||||
| 1631 | ? (char const *const *) &argv[optind] | - | ||||||||||||||||||||||||||||||||||||
| 1632 | : default_file_list); | - | ||||||||||||||||||||||||||||||||||||
| 1633 | - | |||||||||||||||||||||||||||||||||||||
| 1634 | xset_binary_mode ( | - | ||||||||||||||||||||||||||||||||||||
| 1635 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 1636 | , | - | ||||||||||||||||||||||||||||||||||||
| 1637 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 1638 | ); | - | ||||||||||||||||||||||||||||||||||||
| 1639 | - | |||||||||||||||||||||||||||||||||||||
| 1640 | for (i = 0; file_list[i]
| 2608-2616 | ||||||||||||||||||||||||||||||||||||
| 1641 | ok &= head_file (file_list[i], n_units, count_lines, elide_from_end); executed 2616 times by 1 test: ok &= head_file (file_list[i], n_units, count_lines, elide_from_end);Executed by:
| 2616 | ||||||||||||||||||||||||||||||||||||
| 1642 | - | |||||||||||||||||||||||||||||||||||||
| 1643 | if (have_read_stdin
| 0-2336 | ||||||||||||||||||||||||||||||||||||
| 1644 | 0
| 0-272 | ||||||||||||||||||||||||||||||||||||
| 1645 | ) < 0
| 0-272 | ||||||||||||||||||||||||||||||||||||
| 1646 | (( never executed: !!sizeof (struct { _Static_assert (((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1647 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1648 | , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1649 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1650 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1651 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1652 | , "-"), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1653 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1654 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1655 | 1 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1656 | , never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1657 | (*__errno_location ()) never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1658 | , "-"), (( never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1659 | 0 never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1660 | ) ? (void) 0 : __builtin_unreachable ())))); never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"-\"), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "-"), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); | 0 | ||||||||||||||||||||||||||||||||||||
| 1661 | - | |||||||||||||||||||||||||||||||||||||
| 1662 | return executed 2608 times by 1 test: ok ? return ok ? 0 : 1 ;Executed by:
executed 2608 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1663 | 0 executed 2608 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1664 | : executed 2608 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1665 | 1 executed 2608 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1666 | ; executed 2608 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 2608 | ||||||||||||||||||||||||||||||||||||
| 1667 | } | - | ||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |