2 * cmdline.c - Prompt handling
4 * Copyright (C) 2001, 2002 Ethan Benson
8 * Copyright (C) 1996 Maurizio Plaza
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 char passwdbuff[CMD_LENG];
43 void cmdedit (void (*tabfunc) (void), int password)
46 char *buff = password ? passwdbuff : cbuff;
47 for (x = 0; x < CMD_LENG - 1; x++) {
60 if (c == '\n' || c == '\r') {
63 if (c == '\t' && !x && tabfunc)
65 if (c == '\b' || c == 0x7F) {
71 } else if ((c & 0xE0) != 0) {
72 if (x < CMD_LENG - 1) {
78 prom_printf(buff + x);
81 if (x == 1 && !password && useconf) {
82 if (cfg_get_flag (cbuff, "single-key"))