changeset 35461:f0f0e9179ed6

(Fformat): Don't extend text properties from arguments to padding chars in the result.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 22 Jan 2001 13:10:20 +0000
parents fdc935c7dceb
children 928ab33f2cb1
files src/editfns.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Mon Jan 22 12:01:21 2001 +0000
+++ b/src/editfns.c	Mon Jan 22 13:10:20 2001 +0000
@@ -3310,9 +3310,8 @@
 
 	  if (STRINGP (args[n]))
 	    {
-	      int padding, nbytes;
+	      int padding, nbytes, start, end;
 	      int width = lisp_string_width (args[n], -1, NULL, NULL);
-	      int start = nchars;
 
 	      /* If spec requires it, pad on right with spaces.  */
 	      padding = minlen - width;
@@ -3320,9 +3319,11 @@
 		while (padding-- > 0)
 		  {
 		    *p++ = ' ';
-		    nchars++;
+		    ++nchars;
 		  }
 
+	      start = nchars;
+	      
 	      if (p > buf
 		  && multibyte
 		  && !ASCII_BYTE_P (*((unsigned char *) p - 1))
@@ -3334,6 +3335,7 @@
 				  STRING_MULTIBYTE (args[n]), multibyte);
 	      p += nbytes;
 	      nchars += XSTRING (args[n])->size;
+	      end = nchars;
 
 	      if (negative)
 		while (padding-- > 0)
@@ -3354,7 +3356,7 @@
 		    }
 
 		  info[n].start = start;
-		  info[n].end = nchars;
+		  info[n].end = end;
 		}
 	    }
 	  else if (INTEGERP (args[n]) || FLOATP (args[n]))