comparison src/error.cc @ 3719:744755872311

[project @ 2000-10-10 21:42:20 by jwe]
author jwe
date Tue, 10 Oct 2000 21:42:21 +0000
parents 9b9efdcbdfd3
children dfb1bfa12afd
comparison
equal deleted inserted replaced
3718:65c6da68ddb3 3719:744755872311
209 verror ("usage", fmt, args); 209 verror ("usage", fmt, args);
210 va_end (args); 210 va_end (args);
211 } 211 }
212 212
213 static void 213 static void
214 pr_where_2 (const char *fmt, va_list args)
215 {
216 if (fmt)
217 {
218 if (*fmt)
219 {
220 int len = strlen (fmt);
221 if (fmt[len - 1] == '\n')
222 {
223 if (len > 1)
224 {
225 char *tmp_fmt = strsave (fmt);
226 tmp_fmt[len - 1] = '\0';
227 verror (0, tmp_fmt, args);
228 delete [] tmp_fmt;
229 }
230 }
231 else
232 verror (0, fmt, args);
233 }
234 }
235 else
236 panic ("pr_where_2: invalid format");
237 }
238
239 static void
214 pr_where_1 (const char *fmt, ...) 240 pr_where_1 (const char *fmt, ...)
215 { 241 {
216 va_list args; 242 va_list args;
217 va_start (args, fmt); 243 va_start (args, fmt);
218 error_1 (0, fmt, args); 244 pr_where_2 (fmt, args);
219 va_end (args); 245 va_end (args);
220 } 246 }
221 247
222 static void 248 static void
223 pr_where (const char *name) 249 pr_where (const char *name)