* Process commands from a file */
| 245 | * Process commands from a file |
| 246 | */ |
| 247 | static int |
| 248 | ReadFile(FILE *fp) |
| 249 | { |
| 250 | char line[LINE_MAX]; |
| 251 | int num, rtn; |
| 252 | |
| 253 | for (num = 1; fgets(line, sizeof(line), fp) != NULL; num++) { |
| 254 | if (*line == '#') |
| 255 | continue; |
| 256 | if ((rtn = DoParseCommand(line)) != 0) { |
| 257 | warnx("line %d: error in file", num); |
| 258 | return (rtn); |
| 259 | } |
| 260 | } |
| 261 | return (CMDRTN_OK); |
| 262 | } |
| 263 | |
| 264 | #ifdef EDITLINE |
| 265 | #ifndef FSTACK |
no test coverage detected