| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/builtins/mapfile.def |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||
| 17 | static int run_callback (const char *, unsigned int, const char *); | - | ||||||||||||||||||||||||||||||
| 18 | static int delim; | - | ||||||||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||||||||
| 20 | static int | - | ||||||||||||||||||||||||||||||
| 21 | run_callback (callback, curindex, curline) | - | ||||||||||||||||||||||||||||||
| 22 | const char *callback; | - | ||||||||||||||||||||||||||||||
| 23 | unsigned int curindex; | - | ||||||||||||||||||||||||||||||
| 24 | const char *curline; | - | ||||||||||||||||||||||||||||||
| 25 | { | - | ||||||||||||||||||||||||||||||
| 26 | unsigned int execlen; | - | ||||||||||||||||||||||||||||||
| 27 | char *execstr, *qline; | - | ||||||||||||||||||||||||||||||
| 28 | int flags; | - | ||||||||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||||||||
| 30 | qline = sh_single_quote (curline); | - | ||||||||||||||||||||||||||||||
| 31 | execlen = strlen (callback) + strlen (qline) + 10; | - | ||||||||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||||||||
| 34 | execlen += 3; | - | ||||||||||||||||||||||||||||||
| 35 | execstr = sh_xmalloc((execlen), "./mapfile.def", 123); | - | ||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||
| 37 | flags = 0x004; | - | ||||||||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||
| 42 | snprintf (execstr, execlen, "%s %d %s", callback, curindex, qline); | - | ||||||||||||||||||||||||||||||
| 43 | sh_xfree((qline), "./mapfile.def", 131); | - | ||||||||||||||||||||||||||||||
| 44 | return executed 31 times by 1 test: evalstring (execstr, return evalstring (execstr, ((void *)0) , flags);Executed by:
executed 31 times by 1 test: return evalstring (execstr, ((void *)0) , flags);Executed by:
| 31 | ||||||||||||||||||||||||||||||
| 45 | ((void *)0) executed 31 times by 1 test: return evalstring (execstr, ((void *)0) , flags);Executed by:
| 31 | ||||||||||||||||||||||||||||||
| 46 | , flags); executed 31 times by 1 test: return evalstring (execstr, ((void *)0) , flags);Executed by:
| 31 | ||||||||||||||||||||||||||||||
| 47 | } | - | ||||||||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||||||||
| 49 | static void | - | ||||||||||||||||||||||||||||||
| 50 | do_chop(line, delim) | - | ||||||||||||||||||||||||||||||
| 51 | char *line; | - | ||||||||||||||||||||||||||||||
| 52 | unsigned char delim; | - | ||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||
| 54 | int length; | - | ||||||||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||||||||
| 56 | length = strlen (line); | - | ||||||||||||||||||||||||||||||
| 57 | if (length
| 0-59 | ||||||||||||||||||||||||||||||
| 58 | line[length-1] = '\0'; executed 56 times by 1 test: line[length-1] = '\0';Executed by:
| 56 | ||||||||||||||||||||||||||||||
| 59 | } executed 59 times by 1 test: end of blockExecuted by:
| 59 | ||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||
| 61 | static int | - | ||||||||||||||||||||||||||||||
| 62 | mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_name, delim, flags) | - | ||||||||||||||||||||||||||||||
| 63 | int fd; | - | ||||||||||||||||||||||||||||||
| 64 | long line_count_goal, origin, nskip, callback_quantum; | - | ||||||||||||||||||||||||||||||
| 65 | char *callback, *array_name; | - | ||||||||||||||||||||||||||||||
| 66 | int delim; | - | ||||||||||||||||||||||||||||||
| 67 | int flags; | - | ||||||||||||||||||||||||||||||
| 68 | { | - | ||||||||||||||||||||||||||||||
| 69 | char *line; | - | ||||||||||||||||||||||||||||||
| 70 | size_t line_length; | - | ||||||||||||||||||||||||||||||
| 71 | unsigned int array_index, line_count; | - | ||||||||||||||||||||||||||||||
| 72 | SHELL_VAR *entry; | - | ||||||||||||||||||||||||||||||
| 73 | int unbuffered_read; | - | ||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||
| 75 | line = | - | ||||||||||||||||||||||||||||||
| 76 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 77 | ; | - | ||||||||||||||||||||||||||||||
| 78 | line_length = 0; | - | ||||||||||||||||||||||||||||||
| 79 | unbuffered_read = 0; | - | ||||||||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||||||||
| 84 | entry = find_or_make_array_variable (array_name, 1); | - | ||||||||||||||||||||||||||||||
| 85 | if (entry == 0
| 0-23 | ||||||||||||||||||||||||||||||
| 86 | { | - | ||||||||||||||||||||||||||||||
| 87 | if (entry
| 0-2 | ||||||||||||||||||||||||||||||
| 88 | err_readonly (array_name); never executed: err_readonly (array_name); | 0 | ||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||
| 90 | return executed 2 times by 1 test: (1);return (1);Executed by:
executed 2 times by 1 test: return (1);Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 91 | } | - | ||||||||||||||||||||||||||||||
| 92 | else if (((((
| 0-23 | ||||||||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||||||||
| 94 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 95 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 96 | "%s: not an indexed array" | - | ||||||||||||||||||||||||||||||
| 97 | , 5) | - | ||||||||||||||||||||||||||||||
| 98 | , array_name); | - | ||||||||||||||||||||||||||||||
| 99 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 100 | } | - | ||||||||||||||||||||||||||||||
| 101 | else if (((((
| 4-19 | ||||||||||||||||||||||||||||||
| 102 | (( executed 4 times by 1 test: entry)->attributes &= ~(0x0001000));((entry)->attributes &= ~(0x0001000));Executed by:
executed 4 times by 1 test: ((entry)->attributes &= ~(0x0001000));Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||
| 104 | if (flags & 0x01
| 2-21 | ||||||||||||||||||||||||||||||
| 105 | array_flush ((ARRAY *)((entry)->value)); executed 21 times by 1 test: array_flush ((ARRAY *)((entry)->value));Executed by:
| 21 | ||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||||||||
| 108 | unbuffered_read = (
| 2-21 | ||||||||||||||||||||||||||||||
| 109 | 1
| 2-21 | ||||||||||||||||||||||||||||||
| 110 | ) < 0)
| 0-21 | ||||||||||||||||||||||||||||||
| 111 | (*__errno_location ())
| 0-2 | ||||||||||||||||||||||||||||||
| 112 | ==
| 0-2 | ||||||||||||||||||||||||||||||
| 113 | 29
| 0-2 | ||||||||||||||||||||||||||||||
| 114 | )
| 0-2 | ||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||||||||
| 119 | if (delim != '\n'
| 1-22 | ||||||||||||||||||||||||||||||
| 120 | unbuffered_read = 1; executed 1 time by 1 test: unbuffered_read = 1;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||||||||
| 122 | zreset (); | - | ||||||||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||
| 125 | for (line_count = 0; line_count < nskip
| 0-23 | ||||||||||||||||||||||||||||||
| 126 | if (zgetline (fd, &line, &line_length, delim, unbuffered_read) < 0
| 0 | ||||||||||||||||||||||||||||||
| 127 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||||||||
| 129 | line = 0; | - | ||||||||||||||||||||||||||||||
| 130 | line_length = 0; | - | ||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||||||||
| 133 | for (array_index = origin, line_count = 1; | - | ||||||||||||||||||||||||||||||
| 134 | zgetline (fd, &line, &line_length, delim, unbuffered_read) != -1
| 20-141 | ||||||||||||||||||||||||||||||
| 135 | array_index++) | - | ||||||||||||||||||||||||||||||
| 136 | { | - | ||||||||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||||||||
| 138 | if (flags & 0x02
| 59-82 | ||||||||||||||||||||||||||||||
| 139 | do_chop (line, delim); executed 59 times by 1 test: do_chop (line, delim);Executed by:
| 59 | ||||||||||||||||||||||||||||||
| 140 | - | |||||||||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||||||||
| 142 | if (callback
| 0-81 | ||||||||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||||||||
| 144 | run_callback (callback, array_index, line); | - | ||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||
| 147 | if (unbuffered_read == 0
| 4-27 | ||||||||||||||||||||||||||||||
| 148 | zsyncfd (fd); executed 27 times by 1 test: zsyncfd (fd);Executed by:
| 27 | ||||||||||||||||||||||||||||||
| 149 | } executed 31 times by 1 test: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||
| 153 | bind_array_element (entry, array_index, line, 0); | - | ||||||||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||||||||
| 156 | line_count++; | - | ||||||||||||||||||||||||||||||
| 157 | if (line_count_goal != 0
| 3-126 | ||||||||||||||||||||||||||||||
| 158 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 159 | } executed 138 times by 1 test: end of blockExecuted by:
| 138 | ||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||
| 161 | sh_xfree((line), "./mapfile.def", 235); | - | ||||||||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||||||||
| 163 | if (unbuffered_read == 0
| 2-21 | ||||||||||||||||||||||||||||||
| 164 | zsyncfd (fd); executed 21 times by 1 test: zsyncfd (fd);Executed by:
| 21 | ||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||
| 166 | return executed 23 times by 1 test: 0;return 0;Executed by:
executed 23 times by 1 test: return 0;Executed by:
| 23 | ||||||||||||||||||||||||||||||
| 167 | } | - | ||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||
| 169 | int | - | ||||||||||||||||||||||||||||||
| 170 | mapfile_builtin (list) | - | ||||||||||||||||||||||||||||||
| 171 | WORD_LIST *list; | - | ||||||||||||||||||||||||||||||
| 172 | { | - | ||||||||||||||||||||||||||||||
| 173 | int opt, code, fd, flags; | - | ||||||||||||||||||||||||||||||
| 174 | intmax_t intval; | - | ||||||||||||||||||||||||||||||
| 175 | long lines, origin, nskip, callback_quantum; | - | ||||||||||||||||||||||||||||||
| 176 | char *array_name, *callback; | - | ||||||||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||||||||
| 178 | fd = 0; | - | ||||||||||||||||||||||||||||||
| 179 | lines = origin = nskip = 0; | - | ||||||||||||||||||||||||||||||
| 180 | flags = 0x01; | - | ||||||||||||||||||||||||||||||
| 181 | callback_quantum = 5000; | - | ||||||||||||||||||||||||||||||
| 182 | callback = 0; | - | ||||||||||||||||||||||||||||||
| 183 | delim = '\n'; | - | ||||||||||||||||||||||||||||||
| 184 | - | |||||||||||||||||||||||||||||||
| 185 | reset_internal_getopt (); | - | ||||||||||||||||||||||||||||||
| 186 | while ((
| 25 | ||||||||||||||||||||||||||||||
| 187 | { | - | ||||||||||||||||||||||||||||||
| 188 | switch (opt) | - | ||||||||||||||||||||||||||||||
| 189 | { | - | ||||||||||||||||||||||||||||||
| 190 | case executed 1 time by 1 test: 'd':case 'd':Executed by:
executed 1 time by 1 test: case 'd':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 191 | delim = *list_optarg; | - | ||||||||||||||||||||||||||||||
| 192 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 193 | case executed 1 time by 1 test: 'u':case 'u':Executed by:
executed 1 time by 1 test: case 'u':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 194 | code = legal_number (list_optarg, &intval); | - | ||||||||||||||||||||||||||||||
| 195 | if (code == 0
| 0-1 | ||||||||||||||||||||||||||||||
| 196 | { | - | ||||||||||||||||||||||||||||||
| 197 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 198 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 199 | "%s: invalid file descriptor specification" | - | ||||||||||||||||||||||||||||||
| 200 | , 5) | - | ||||||||||||||||||||||||||||||
| 201 | , list_optarg); | - | ||||||||||||||||||||||||||||||
| 202 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 203 | } | - | ||||||||||||||||||||||||||||||
| 204 | else | - | ||||||||||||||||||||||||||||||
| 205 | fd = intval; executed 1 time by 1 test: fd = intval;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||||||||
| 207 | if (sh_validfd (fd) == 0
| 0-1 | ||||||||||||||||||||||||||||||
| 208 | { | - | ||||||||||||||||||||||||||||||
| 209 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 210 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 211 | "%d: invalid file descriptor: %s" | - | ||||||||||||||||||||||||||||||
| 212 | , 5) | - | ||||||||||||||||||||||||||||||
| 213 | , fd, strerror ( | - | ||||||||||||||||||||||||||||||
| 214 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 215 | )); | - | ||||||||||||||||||||||||||||||
| 216 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 217 | } | - | ||||||||||||||||||||||||||||||
| 218 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||||||||
| 220 | case executed 4 times by 1 test: 'n':case 'n':Executed by:
executed 4 times by 1 test: case 'n':Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 221 | code = legal_number (list_optarg, &intval); | - | ||||||||||||||||||||||||||||||
| 222 | if (code == 0
| 0-4 | ||||||||||||||||||||||||||||||
| 223 | { | - | ||||||||||||||||||||||||||||||
| 224 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 225 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 226 | "%s: invalid line count" | - | ||||||||||||||||||||||||||||||
| 227 | , 5) | - | ||||||||||||||||||||||||||||||
| 228 | , list_optarg); | - | ||||||||||||||||||||||||||||||
| 229 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 230 | } | - | ||||||||||||||||||||||||||||||
| 231 | else | - | ||||||||||||||||||||||||||||||
| 232 | lines = intval; executed 4 times by 1 test: lines = intval;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 233 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||||||||
| 235 | case executed 2 times by 1 test: 'O':case 'O':Executed by:
executed 2 times by 1 test: case 'O':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 236 | code = legal_number (list_optarg, &intval); | - | ||||||||||||||||||||||||||||||
| 237 | if (code == 0
| 0-2 | ||||||||||||||||||||||||||||||
| 238 | { | - | ||||||||||||||||||||||||||||||
| 239 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 240 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 241 | "%s: invalid array origin" | - | ||||||||||||||||||||||||||||||
| 242 | , 5) | - | ||||||||||||||||||||||||||||||
| 243 | , list_optarg); | - | ||||||||||||||||||||||||||||||
| 244 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 245 | } | - | ||||||||||||||||||||||||||||||
| 246 | else | - | ||||||||||||||||||||||||||||||
| 247 | origin = intval; executed 2 times by 1 test: origin = intval;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 248 | flags &= ~0x01; | - | ||||||||||||||||||||||||||||||
| 249 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 250 | case executed 5 times by 1 test: 't':case 't':Executed by:
executed 5 times by 1 test: case 't':Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 251 | flags |= 0x02; | - | ||||||||||||||||||||||||||||||
| 252 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 253 | case executed 6 times by 1 test: 'C':case 'C':Executed by:
executed 6 times by 1 test: case 'C':Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 254 | callback = list_optarg; | - | ||||||||||||||||||||||||||||||
| 255 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 256 | case executed 6 times by 1 test: 'c':case 'c':Executed by:
executed 6 times by 1 test: case 'c':Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 257 | code = legal_number (list_optarg, &intval); | - | ||||||||||||||||||||||||||||||
| 258 | if (code == 0
| 0-6 | ||||||||||||||||||||||||||||||
| 259 | { | - | ||||||||||||||||||||||||||||||
| 260 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 261 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 262 | "%s: invalid callback quantum" | - | ||||||||||||||||||||||||||||||
| 263 | , 5) | - | ||||||||||||||||||||||||||||||
| 264 | , list_optarg); | - | ||||||||||||||||||||||||||||||
| 265 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 266 | } | - | ||||||||||||||||||||||||||||||
| 267 | else | - | ||||||||||||||||||||||||||||||
| 268 | callback_quantum = intval; executed 6 times by 1 test: callback_quantum = intval;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 269 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 270 | case never executed: 's':case 's':never executed: case 's': | 0 | ||||||||||||||||||||||||||||||
| 271 | code = legal_number (list_optarg, &intval); | - | ||||||||||||||||||||||||||||||
| 272 | if (code == 0
| 0 | ||||||||||||||||||||||||||||||
| 273 | { | - | ||||||||||||||||||||||||||||||
| 274 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 275 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 276 | "%s: invalid line count" | - | ||||||||||||||||||||||||||||||
| 277 | , 5) | - | ||||||||||||||||||||||||||||||
| 278 | , list_optarg); | - | ||||||||||||||||||||||||||||||
| 279 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 280 | } | - | ||||||||||||||||||||||||||||||
| 281 | else | - | ||||||||||||||||||||||||||||||
| 282 | nskip = intval; never executed: nskip = intval; | 0 | ||||||||||||||||||||||||||||||
| 283 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 284 | case never executed: -99:case -99:never executed: builtin_help (); returncase -99:never executed: (258);return (258);never executed: return (258); | 0 | ||||||||||||||||||||||||||||||
| 285 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||
| 286 | builtin_usage (); | - | ||||||||||||||||||||||||||||||
| 287 | return never executed: (258);return (258);never executed: return (258); | 0 | ||||||||||||||||||||||||||||||
| 288 | } | - | ||||||||||||||||||||||||||||||
| 289 | } | - | ||||||||||||||||||||||||||||||
| 290 | list = loptend; | - | ||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||
| 292 | if (list == 0
| 0-25 | ||||||||||||||||||||||||||||||
| 293 | array_name = "MAPFILE"; never executed: array_name = "MAPFILE"; | 0 | ||||||||||||||||||||||||||||||
| 294 | else if (list->word == 0
| 0-25 | ||||||||||||||||||||||||||||||
| 295 | { | - | ||||||||||||||||||||||||||||||
| 296 | builtin_error ("internal error: getting variable name"); | - | ||||||||||||||||||||||||||||||
| 297 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 298 | } | - | ||||||||||||||||||||||||||||||
| 299 | else if (list->word->word[0] == '\0'
| 0-25 | ||||||||||||||||||||||||||||||
| 300 | { | - | ||||||||||||||||||||||||||||||
| 301 | builtin_error ( | - | ||||||||||||||||||||||||||||||
| 302 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||
| 303 | "empty array variable name" | - | ||||||||||||||||||||||||||||||
| 304 | , 5) | - | ||||||||||||||||||||||||||||||
| 305 | ); | - | ||||||||||||||||||||||||||||||
| 306 | return never executed: (258);return (258);never executed: return (258); | 0 | ||||||||||||||||||||||||||||||
| 307 | } | - | ||||||||||||||||||||||||||||||
| 308 | else | - | ||||||||||||||||||||||||||||||
| 309 | array_name = list->word->word; executed 25 times by 1 test: array_name = list->word->word;Executed by:
| 25 | ||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||
| 311 | if (legal_identifier (array_name) == 0
| 0-25 | ||||||||||||||||||||||||||||||
| 312 | { | - | ||||||||||||||||||||||||||||||
| 313 | sh_invalidid (array_name); | - | ||||||||||||||||||||||||||||||
| 314 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 315 | } | - | ||||||||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||||||||
| 317 | return executed 25 times by 1 test: mapfile (fd, lines, origin, nskip, callback_quantum, callback, array_name, delim, flags);return mapfile (fd, lines, origin, nskip, callback_quantum, callback, array_name, delim, flags);Executed by:
executed 25 times by 1 test: return mapfile (fd, lines, origin, nskip, callback_quantum, callback, array_name, delim, flags);Executed by:
| 25 | ||||||||||||||||||||||||||||||
| 318 | } | - | ||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |