aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorMiles Bader2004-10-27 06:03:07 +0000
committerMiles Bader2004-10-27 06:03:07 +0000
commit68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e (patch)
treec03104b7ab1750759f40ce18d230093e0ea49824 /src/editfns.c
parente0da2cddda8d2244be17fe33fd3130af8c8041c8 (diff)
parentfce59e4038c02d88aca0ba6ef06db7ceb991d279 (diff)
downloademacs-68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e.tar.gz
emacs-68c015f511f43f6d24ac79ac78cd4a7b3cd5a89e.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-66
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-642 Update from CVS
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/editfns.c b/src/editfns.c
index c3a69fc3f0c..e1482936fe5 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2858,7 +2858,7 @@ It returns the number of characters changed. */)
2858 2858
2859 pos = XINT (start); 2859 pos = XINT (start);
2860 pos_byte = CHAR_TO_BYTE (pos); 2860 pos_byte = CHAR_TO_BYTE (pos);
2861 end_pos = XINT (end); 2861 end_pos = XINT (end);
2862 modify_region (current_buffer, pos, end_pos); 2862 modify_region (current_buffer, pos, end_pos);
2863 2863
2864 cnt = 0; 2864 cnt = 0;
@@ -3387,7 +3387,7 @@ usage: (format STRING &rest OBJECTS) */)
3387 /* discarded[I] is 1 if byte I of the format 3387 /* discarded[I] is 1 if byte I of the format
3388 string was not copied into the output. 3388 string was not copied into the output.
3389 It is 2 if byte I was not the first byte of its character. */ 3389 It is 2 if byte I was not the first byte of its character. */
3390 char *discarded; 3390 char *discarded = 0;
3391 3391
3392 /* Each element records, for one argument, 3392 /* Each element records, for one argument,
3393 the start and end bytepos in the output string, 3393 the start and end bytepos in the output string,
@@ -3438,11 +3438,13 @@ usage: (format STRING &rest OBJECTS) */)
3438 { 3438 {
3439 int nbytes = (nargs+1) * sizeof *info; 3439 int nbytes = (nargs+1) * sizeof *info;
3440 int i; 3440 int i;
3441 info = (struct info *) alloca (nbytes); 3441 if (!info)
3442 info = (struct info *) alloca (nbytes);
3442 bzero (info, nbytes); 3443 bzero (info, nbytes);
3443 for (i = 0; i <= nargs; i++) 3444 for (i = 0; i <= nargs; i++)
3444 info[i].start = -1; 3445 info[i].start = -1;
3445 discarded = (char *) alloca (SBYTES (args[0])); 3446 if (!discarded)
3447 SAFE_ALLOCA (discarded, char *, SBYTES (args[0]));
3446 bzero (discarded, SBYTES (args[0])); 3448 bzero (discarded, SBYTES (args[0]));
3447 } 3449 }
3448 3450
@@ -3803,7 +3805,7 @@ usage: (format STRING &rest OBJECTS) */)
3803 val = make_specified_string (buf, nchars, p - buf, multibyte); 3805 val = make_specified_string (buf, nchars, p - buf, multibyte);
3804 3806
3805 /* If we allocated BUF with malloc, free it too. */ 3807 /* If we allocated BUF with malloc, free it too. */
3806 SAFE_FREE (total); 3808 SAFE_FREE ();
3807 3809
3808 /* If the format string has text properties, or any of the string 3810 /* If the format string has text properties, or any of the string
3809 arguments has text properties, set up text properties of the 3811 arguments has text properties, set up text properties of the
@@ -4187,7 +4189,7 @@ Transposing beyond buffer boundaries is an error. */)
4187 bcopy (start2_addr, temp, len2_byte); 4189 bcopy (start2_addr, temp, len2_byte);
4188 bcopy (start1_addr, start1_addr + len2_byte, len1_byte); 4190 bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
4189 bcopy (temp, start1_addr, len2_byte); 4191 bcopy (temp, start1_addr, len2_byte);
4190 SAFE_FREE (len2_byte); 4192 SAFE_FREE ();
4191 } 4193 }
4192 else 4194 else
4193 /* First region not smaller than second. */ 4195 /* First region not smaller than second. */
@@ -4200,7 +4202,7 @@ Transposing beyond buffer boundaries is an error. */)
4200 bcopy (start1_addr, temp, len1_byte); 4202 bcopy (start1_addr, temp, len1_byte);
4201 bcopy (start2_addr, start1_addr, len2_byte); 4203 bcopy (start2_addr, start1_addr, len2_byte);
4202 bcopy (temp, start1_addr + len2_byte, len1_byte); 4204 bcopy (temp, start1_addr + len2_byte, len1_byte);
4203 SAFE_FREE (len1_byte); 4205 SAFE_FREE ();
4204 } 4206 }
4205 graft_intervals_into_buffer (tmp_interval1, start1 + len2, 4207 graft_intervals_into_buffer (tmp_interval1, start1 + len2,
4206 len1, current_buffer, 0); 4208 len1, current_buffer, 0);
@@ -4236,7 +4238,7 @@ Transposing beyond buffer boundaries is an error. */)
4236 bcopy (start1_addr, temp, len1_byte); 4238 bcopy (start1_addr, temp, len1_byte);
4237 bcopy (start2_addr, start1_addr, len2_byte); 4239 bcopy (start2_addr, start1_addr, len2_byte);
4238 bcopy (temp, start2_addr, len1_byte); 4240 bcopy (temp, start2_addr, len1_byte);
4239 SAFE_FREE (len1_byte); 4241 SAFE_FREE ();
4240 4242
4241 graft_intervals_into_buffer (tmp_interval1, start2, 4243 graft_intervals_into_buffer (tmp_interval1, start2,
4242 len1, current_buffer, 0); 4244 len1, current_buffer, 0);
@@ -4265,7 +4267,7 @@ Transposing beyond buffer boundaries is an error. */)
4265 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); 4267 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
4266 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4268 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4267 bcopy (temp, start1_addr, len2_byte); 4269 bcopy (temp, start1_addr, len2_byte);
4268 SAFE_FREE (len2_byte); 4270 SAFE_FREE ();
4269 4271
4270 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4272 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4271 len1, current_buffer, 0); 4273 len1, current_buffer, 0);
@@ -4296,7 +4298,7 @@ Transposing beyond buffer boundaries is an error. */)
4296 bcopy (start2_addr, start1_addr, len2_byte); 4298 bcopy (start2_addr, start1_addr, len2_byte);
4297 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4299 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4298 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); 4300 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
4299 SAFE_FREE (len1_byte); 4301 SAFE_FREE ();
4300 4302
4301 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4303 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4302 len1, current_buffer, 0); 4304 len1, current_buffer, 0);