aboutsummaryrefslogtreecommitdiffstats
path: root/src/tparam.c
diff options
context:
space:
mode:
authorKenichi Handa2004-04-16 12:51:06 +0000
committerKenichi Handa2004-04-16 12:51:06 +0000
commit6b61353c0a0320ee15bb6488149735381fed62ec (patch)
treee69adba60e504a5a37beb556ad70084de88a7aab /src/tparam.c
parentdc6a28319312fe81f7a1015e363174022313f0bd (diff)
downloademacs-6b61353c0a0320ee15bb6488149735381fed62ec.tar.gz
emacs-6b61353c0a0320ee15bb6488149735381fed62ec.zip
Sync to HEAD
Diffstat (limited to 'src/tparam.c')
-rw-r--r--src/tparam.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/tparam.c b/src/tparam.c
index fb71e05b3e4..ea208692161 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -144,7 +144,9 @@ tparam1 (string, outstring, len, up, left, argp)
144 int outlen = 0; 144 int outlen = 0;
145 145
146 register int tem; 146 register int tem;
147 int *old_argp = argp; 147 int *old_argp = argp; /* can move */
148 int *fixed_argp = argp; /* never moves */
149 int explicit_param_p = 0; /* set by %p */
148 int doleft = 0; 150 int doleft = 0;
149 int doup = 0; 151 int doup = 0;
150 152
@@ -180,7 +182,10 @@ tparam1 (string, outstring, len, up, left, argp)
180 if (c == '%') 182 if (c == '%')
181 { 183 {
182 c = *p++; 184 c = *p++;
183 tem = *argp; 185 if (explicit_param_p)
186 explicit_param_p = 0;
187 else
188 tem = *argp;
184 switch (c) 189 switch (c)
185 { 190 {
186 case 'd': /* %d means output in decimal. */ 191 case 'd': /* %d means output in decimal. */
@@ -203,7 +208,10 @@ tparam1 (string, outstring, len, up, left, argp)
203 *op++ = tem % 10 + '0'; 208 *op++ = tem % 10 + '0';
204 argp++; 209 argp++;
205 break; 210 break;
206 211 case 'p': /* %pN means use param N for next subst. */
212 tem = fixed_argp[(*p++) - '1'];
213 explicit_param_p = 1;
214 break;
207 case 'C': 215 case 'C':
208 /* For c-100: print quotient of value by 96, if nonzero, 216 /* For c-100: print quotient of value by 96, if nonzero,
209 then do like %+. */ 217 then do like %+. */
@@ -334,3 +342,6 @@ main (argc, argv)
334} 342}
335 343
336#endif /* DEBUG */ 344#endif /* DEBUG */
345
346/* arch-tag: 83f7b5ac-a808-4f75-b87a-123de009b402
347 (do not change this comment) */