*** tw.c.orig Fri May 28 19:39:10 2004 --- tw.c Wed Jun 2 12:32:09 2004 *************** *** 91,96 **** --- 91,97 ---- { P *p = pdup(bw->cursor); static unsigned char buf1[stdsiz]; + int i, j, spc; buf1[0] = 0; *************** *** 110,116 **** stdbuf[0]=='B' && stdbuf[1]=='E' && stdbuf[2]=='G' && stdbuf[3]=='I' && stdbuf[4]=='N' || stdbuf[0]=='-' && stdbuf[1]=='-' || stdbuf[0]==';')) { ! strcpy(buf1,stdbuf); /* Uncomment to get the last line instead of the first line (see above) if (pprevl(p)) { p_goto_bol(p); --- 111,126 ---- stdbuf[0]=='B' && stdbuf[1]=='E' && stdbuf[2]=='G' && stdbuf[3]=='I' && stdbuf[4]=='N' || stdbuf[0]=='-' && stdbuf[1]=='-' || stdbuf[0]==';')) { ! /* replace tabs to spaces and remove adjoining spaces */ ! for (i=0,j=0,spc=0; stdbuf[i]; i++) { ! if (stdbuf[i]=='\t' || stdbuf[i]==' ') { ! if (spc) continue; ! spc = 1; ! } ! else spc = 0; ! buf1[j++] = (stdbuf[i]=='\t')? ' ' : stdbuf[i]; ! } ! buf1[j]= '\0'; /* Uncomment to get the last line instead of the first line (see above) if (pprevl(p)) { p_goto_bol(p);