diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-02-16 20:53:00 +0000 | 
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-02-16 20:53:00 +0000 | 
| commit | fbffe7d98781b448ff10adba66af5adf33fc6d49 (patch) | |
| tree | 884fe27a95899bd687197c90dd253a786d563650 /lib-src/fakemail.c | |
| parent | f7da6740cab88c131a7418e08830f35afbe1c5b3 (diff) | |
| download | emacs-fbffe7d98781b448ff10adba66af5adf33fc6d49.tar.gz | |
(put_line): Don't break the line if it all fits.
Diffstat (limited to 'lib-src/fakemail.c')
| -rw-r--r-- | lib-src/fakemail.c | 23 | 
1 files changed, 14 insertions, 9 deletions
| diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 145e51efd01..757b4e1cb6b 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -421,7 +421,7 @@ put_line (string)  	{  	  char *breakpos; -	  /* Find the last char that fits. */ +	  /* Find the last char that fits.  */  	  for (breakpos = s; *breakpos && column < 78; ++breakpos)  	    {  	      if (*breakpos == '\t') @@ -429,15 +429,20 @@ put_line (string)  	      else  		column++;  	    } -	  /* Back up to just after the last comma that fits.  */ -	  while (breakpos != s && breakpos[-1] != ',') --breakpos; -	  if (breakpos == s) +	  /* If we didn't reach end of line, break the line.  */ +	  if (*breakpos)  	    { -	      /* If no comma fits, move past the first address anyway.  */ -	      while (*breakpos != 0 && *breakpos != ',') ++breakpos; -	      if (*breakpos != 0) -		/* Include the comma after it.  */ -		++breakpos; +	      /* Back up to just after the last comma that fits.  */ +	      while (breakpos != s && breakpos[-1] != ',') --breakpos; + +	      if (breakpos == s) +		{ +		  /* If no comma fits, move past the first address anyway.  */ +		  while (*breakpos != 0 && *breakpos != ',') ++breakpos; +		  if (*breakpos != 0) +		    /* Include the comma after it.  */ +		    ++breakpos; +		}  	    }  	  /* Output that much, then break the line.  */  	  fwrite (s, 1, breakpos - s, rem->handle); | 
