Commit 06c22bb2 authored by rswindell's avatar rswindell
Browse files

Disables stdout buffering.

Improved ulist() Which prompt.
parent ecb5f4db
...@@ -46,6 +46,7 @@ uint cursor,helpline=0,max_opts=MAX_OPTS; ...@@ -46,6 +46,7 @@ uint cursor,helpline=0,max_opts=MAX_OPTS;
int uifcini() int uifcini()
{ {
setvbuf(stdout,NULL,_IONBF,0);
scrn_len=24; scrn_len=24;
return(scrn_len); return(scrn_len);
...@@ -136,7 +137,7 @@ int ulist(int mode, char left, int top, char width, int *cur, int *bar ...@@ -136,7 +137,7 @@ int ulist(int mode, char left, int top, char width, int *cur, int *bar
strcat(str,", Add"); strcat(str,", Add");
if(mode&WIN_DEL) if(mode&WIN_DEL)
strcat(str,", Delete"); strcat(str,", Delete");
printf("\nWhich (Help%s): ",str); printf("\nWhich (Help%s or Quit): ",str);
} }
str[0]=0; str[0]=0;
fgets(str,sizeof(str)-1,stdin); fgets(str,sizeof(str)-1,stdin);
...@@ -169,35 +170,40 @@ int ulist(int mode, char left, int top, char width, int *cur, int *bar ...@@ -169,35 +170,40 @@ int ulist(int mode, char left, int top, char width, int *cur, int *bar
printf("Help\n"); printf("Help\n");
help(); help();
break; break;
case 'A': case 'A': /* Add/Insert */
if(!opts) if(!opts)
return(MSK_INS); return(MSK_INS);
if(i>0 && i<=opts+1) if(i>0 && i<=opts+1)
return((i-1)|MSK_INS); return((i-1)|MSK_INS);
return(which("Add before",opts+1)|MSK_INS); return(which("Add before",opts+1)|MSK_INS);
break; break;
case 'D': case 'D': /* Delete */
if(!opts) if(!opts)
break; break;
if(i>0 && i<=opts) if(i>0 && i<=opts)
return((i-1)|MSK_DEL); return((i-1)|MSK_DEL);
return(which("Delete",opts)|MSK_INS); if(opts==1)
return(MSK_DEL);
return(which("Delete",opts)|MSK_DEL);
break; break;
case 'C': case 'C': /* Copy/Get */
if(!opts) if(!opts)
break; break;
if(i>0 && i<=opts) if(i>0 && i<=opts)
return((i-1)|MSK_GET); return((i-1)|MSK_GET);
if(opts==1)
return(MSK_GET);
return(which("Copy",opts)|MSK_GET); return(which("Copy",opts)|MSK_GET);
break; break;
case 'P': case 'P': /* Paste/Put */
if(!opts) if(!opts)
break; break;
if(i>0 && i<=opts) if(i>0 && i<=opts)
return((i-1)|MSK_PUT); return((i-1)|MSK_PUT);
if(opts==1)
return(MSK_PUT);
return(which("Paste",opts)|MSK_PUT); return(which("Paste",opts)|MSK_PUT);
break; break;
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment