Polishing multi-line dialog

This commit is contained in:
Thomas Schmitt 2008-10-10 13:41:07 +00:00
parent 794895bec0
commit 5fada4d1ac
2 changed files with 9 additions and 13 deletions

View File

@ -3601,11 +3601,9 @@ get_single:;
if(l >= linesize - base_length - 1) { if(l >= linesize - base_length - 1) {
strncpy(linept, cpt, linesize - 1); strncpy(linept, cpt, linesize - 1);
line[sizeof(line)-1]= 0; line[sizeof(line)-1]= 0;
sprintf(xorriso->info_text,"Input line too long !");
/* >>> Line overflow. Raise alert */; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
/* <<< */ goto new_empty;
goto process_history;
} else } else
strcpy(linept, cpt); strcpy(linept, cpt);
} }
@ -3628,9 +3626,10 @@ process_single:;
if(linept != line && strcmp(linept, "@@@") == 0) { if(linept != line && strcmp(linept, "@@@") == 0) {
sprintf(xorriso->info_text, "Incomplete input line cleared by %s", sprintf(xorriso->info_text, "Incomplete input line cleared by %s",
linept); linept);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE",0);
new_empty:;
line[0]= 0; line[0]= 0;
linept= line; linept= line;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE",0);
sprintf(xorriso->info_text, "-------------------------------------\n"); sprintf(xorriso->info_text, "-------------------------------------\n");
Xorriso_info(xorriso,0); Xorriso_info(xorriso,0);
sprintf(xorriso->info_text, "Enter new text for empty input line :\n"); sprintf(xorriso->info_text, "Enter new text for empty input line :\n");
@ -3651,11 +3650,9 @@ process_single:;
if(ret == 0 && strlen(line) < linesize - 1 && !append_line) { if(ret == 0 && strlen(line) < linesize - 1 && !append_line) {
/* append a newline character */ /* append a newline character */
if(l >= linesize - 1) { if(l >= linesize - 1) {
sprintf(xorriso->info_text,"Input line too long !");
/* >>> Line overflow. Raise alert */; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
/* <<< */ goto new_empty;
goto process_history;
} }
line[l]= '\n'; line[l]= '\n';
line[l + 1]= 0; line[l + 1]= 0;
@ -3677,7 +3674,6 @@ process_single:;
#ifdef Xorriso_with_readlinE #ifdef Xorriso_with_readlinE
process_history:;
if(line[0]!=0 && strcmp(last_input,line)!=0 && !(flag&1)) if(line[0]!=0 && strcmp(last_input,line)!=0 && !(flag&1))
if(!((flag&4) && if(!((flag&4) &&
(strncmp(line,"-history:",9)==0 || strncmp(line,"-history ",9)==0))) { (strncmp(line,"-history:",9)==0 || strncmp(line,"-history ",9)==0))) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.10.10.131102" #define Xorriso_timestamP "2008.10.10.134020"