aewl

diff 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
line diff
     1.1 --- a/main.c	Sun Nov 26 14:26:53 2006 +0100
     1.2 +++ b/main.c	Sun Nov 26 15:43:16 2006 +0100
     1.3 @@ -284,8 +284,8 @@
     1.4  				readin = False;
     1.5  				break;
     1.6  			default:
     1.7 -				stext[r - (stext[r - 1] == '\n' ? 1 : 0)] = '\0';
     1.8 -				for(p = stext + strlen(stext) - 1; p > stext && *p != '\n'; --p);
     1.9 +				for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
    1.10 +				for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p);
    1.11  				if(p > stext)
    1.12  					strncpy(stext, p + 1, sizeof stext);
    1.13  			}