unsigned i = 1;
char *curr;
- do {
+ while (1) {
curr = old + end - i;
if (*curr < 'z') {
*curr += 1;
return NULL;
}
*curr = 'a';
- } while (1);
+ }
return old;
}
term.c_lflag &= ~(ECHO | ECHOCTL);
tcsetattr_stdin_TCSANOW(&term);
- do {
+ while (1) {
printf("Virtual console%s locked by %s.\n",
- option_mask32 /*o_lock_all*/ ? "s" : "",
- pw->pw_name);
+ /* "s" if -a, else "": */ "s" + !option_mask32,
+ pw->pw_name
+ );
if (correct_password(pw)) {
break;
}
bb_do_delay(FAIL_DELAY);
puts("Password incorrect");
- } while (1);
+ }
#ifdef __linux__
ioctl(STDIN_FILENO, VT_SETMODE, &ovtm);
set_flags(flags, (iflags & IPV6_MASK));
r = 0;
- do {
+ while (1) {
inet_pton(AF_INET6, addr6x + r,
(struct sockaddr *) &snaddr6.sin6_addr);
snaddr6.sin6_family = AF_INET6;
free(naddr6);
break;
}
- } while (1);
+ }
}
fclose(fp);
}
/* first remove from list */
jpp = curp = &curjob;
- do {
+ while (1) {
jp1 = *jpp;
if (jp1 == jp)
break;
jpp = &jp1->prev_job;
- } while (1);
+ }
*jpp = jp1->prev_job;
/* Then re-insert in correct position */
case CUR_RUNNING:
/* newly created job or backgrounded job,
put after all stopped jobs. */
- do {
+ while (1) {
jp1 = *jpp;
#if JOBS
if (!jp1 || jp1->state != JOBSTOPPED)
#endif
break;
jpp = &jp1->prev_job;
- } while (1);
+ }
/* FALLTHROUGH */
#if JOBS
case CUR_STOPPED:
goto out;
/* fd is a tty at this point */
close_on_exec_on(fd);
- do { /* while we are in the background */
+ while (1) { /* while we are in the background */
pgrp = tcgetpgrp(fd);
if (pgrp < 0) {
out:
if (pgrp == getpgrp())
break;
killpg(0, SIGTTIN);
- } while (1);
+ }
initialpgrp = pgrp;
setsignal(SIGTSTP);
p = expdest - 1;
*p = '\0';
p--;
- do {
+ while (1) {
int esc;
while ((unsigned char)*p != CTLARI) {
}
p -= esc + 1;
- } while (1);
+ }
begoff = p - start;