diff options
| author | Simon <simon@hardwired.org.uk> | 2011-01-30 23:20:12 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2011-01-30 23:20:12 (GMT) |
| commit | 61292f5355bb85b3e6e293c5c5b0a2de10d0cd2d (patch) | |
| tree | 91722142361954dc6a3d0ea6e140311edf1f1ba0 /src/interface.c | |
| parent | bcbcb0063b1f3451b4e329b69d275bcabadc788a (diff) | |
| parent | 6aaa9e78cd8ce2e11b6696f979a17d92e1c7fc40 (diff) | |
| download | powder-61292f5355bb85b3e6e293c5c5b0a2de10d0cd2d.zip powder-61292f5355bb85b3e6e293c5c5b0a2de10d0cd2d.tar.gz | |
Fix bugs with console.
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c index 0d963e0..23359ed 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3883,7 +3883,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show currentcommand->prev_command = last_command; currentcommand->command = mystrdup(ed.str); last_command = currentcommand; - return ed.str; + return currentcommand->command; } if (sdl_key==SDLK_ESCAPE || sdl_key==SDLK_BACKQUOTE) { @@ -3898,6 +3898,7 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show if(ci==-1) { strcpy(ed.str, ""); + ed.cursor = strlen(ed.str); } else { @@ -3910,11 +3911,13 @@ char *console_ui(pixel *vid_buf,char error[255]) { //TODO: error messages, show currentcommand = currentcommand->prev_command; } strcpy(ed.str, currentcommand->command); + ed.cursor = strlen(ed.str); } else { ci = -1; strcpy(ed.str, ""); + ed.cursor = strlen(ed.str); } } } |
