}
if (tty_input) {
stat = get_cmd(input, prompt, UA_sock, 30);
- clrbrk();
+ if (usrbrk() == 1) {
+ clrbrk();
+ }
+ if (usrbrk()) {
+ break;
+ }
} else {
+ /* Reading input from a file */
int len = sizeof_pool_memory(UA_sock->msg) - 1;
- if (fgets(UA_sock->msg, len, input) == NULL || usrbrk()) {
+ if (usrbrk()) {
+ break;
+ }
+ if (fgets(UA_sock->msg, len, input) == NULL) {
stat = -1;
} else {
sendit(UA_sock->msg); /* echo to terminal */
sendit(UA_sock->msg);
}
}
+ if (usrbrk() > 1) {
+ break;
+ } else {
+ clrbrk();
+ }
if (!stop) {
fflush(stdout);
}
LockRes();
CONRES *cons = (CONRES *)GetNextRes(R_CONSOLE, (RES *)NULL);
UnlockRes();
+ /* If cons==NULL, default console will be used */
if (!authenticate_director(&jcr, dir, cons)) {
fprintf(stderr, "ERR=%s", UA_sock->msg);
terminate_console(0);