comparison main.c @ 582:70472540c443

applied yet another proposal of Manuel
author arg@mig29
date Sun, 26 Nov 2006 15:43:16 +0100
parents 601842ee4484
children f4285a97e3e6
comparison
equal deleted inserted replaced
581:601842ee4484 582:70472540c443
282 case 0: 282 case 0:
283 strncpy(stext, "EOF", sizeof stext); 283 strncpy(stext, "EOF", sizeof stext);
284 readin = False; 284 readin = False;
285 break; 285 break;
286 default: 286 default:
287 stext[r - (stext[r - 1] == '\n' ? 1 : 0)] = '\0'; 287 for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
288 for(p = stext + strlen(stext) - 1; p > stext && *p != '\n'; --p); 288 for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p);
289 if(p > stext) 289 if(p > stext)
290 strncpy(stext, p + 1, sizeof stext); 290 strncpy(stext, p + 1, sizeof stext);
291 } 291 }
292 drawstatus(); 292 drawstatus();
293 } 293 }