Mercurial > emacs
comparison src/editfns.c @ 13450:9a1e7191803f
(Fformat): Use doprnt_lisp.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 10 Nov 1995 06:41:14 +0000 |
parents | 186d80572f4f |
children | 5fe951036f57 |
comparison
equal
deleted
inserted
replaced
13449:2e9306561b80 | 13450:9a1e7191803f |
---|---|
1894 u.d = XFLOAT (args[n])->data; | 1894 u.d = XFLOAT (args[n])->data; |
1895 strings[i++] = (unsigned char *) u.half[0]; | 1895 strings[i++] = (unsigned char *) u.half[0]; |
1896 strings[i++] = (unsigned char *) u.half[1]; | 1896 strings[i++] = (unsigned char *) u.half[1]; |
1897 } | 1897 } |
1898 #endif | 1898 #endif |
1899 else if (i == 0) | |
1900 /* The first string is treated differently | |
1901 because it is the format string. */ | |
1902 strings[i++] = XSTRING (args[n])->data; | |
1899 else | 1903 else |
1900 strings[i++] = XSTRING (args[n])->data; | 1904 strings[i++] = (unsigned char *) XFASTINT (args[n]); |
1901 } | 1905 } |
1902 | 1906 |
1903 /* Make room in result for all the non-%-codes in the control string. */ | 1907 /* Make room in result for all the non-%-codes in the control string. */ |
1904 total += XSTRING (args[0])->size; | 1908 total += XSTRING (args[0])->size; |
1905 | 1909 |
1907 while (1) | 1911 while (1) |
1908 { | 1912 { |
1909 buf = (char *) alloca (total + 1); | 1913 buf = (char *) alloca (total + 1); |
1910 buf[total - 1] = 0; | 1914 buf[total - 1] = 0; |
1911 | 1915 |
1912 length = doprnt (buf, total + 1, strings[0], end, i-1, strings + 1); | 1916 length = doprnt_lisp (buf, total + 1, strings[0], |
1917 end, i-1, strings + 1); | |
1913 if (buf[total - 1] == 0) | 1918 if (buf[total - 1] == 0) |
1914 break; | 1919 break; |
1915 | 1920 |
1916 total *= 2; | 1921 total *= 2; |
1917 } | 1922 } |