- for (fn[12] = 64;fn[12] < 64 + 53;++fn[12]) {
- fd = open_read(fn);
- if (fd == -1) {
- if (errno != error_noent)
- strerr_die4sys(111,FATAL,"unable to open ",fn,": ");
- }
- else {
- substdio_fdbuf(&in,read,fd,inbuf,sizeof(inbuf));
- for (;;) {
- if (getln(&in,&line,&match,'\0') == -1)
- strerr_die4sys(111,FATAL,"unable to read ",fn,": ");
- if (!match) break;
- if (line.s[str_chr(line.s,'\n')])
- strerr_die3x(111,FATAL,"newline in ",fn);
- if (substdio_puts(&out,line.s + 1)) die_write();
- if (substdio_put(&out,"\n",1) == -1) die_write();
- }
- }
+ if (chdir(dir) == -1)
+ strerr_die4sys(111,FATAL,ERR_SWITCH,dir,": ");