Branch: Tag:

2004-03-23

2004-03-23 13:41:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported various convenience functions from Pike 7.5.

Rev: src/cpp.c:1.110
Rev: src/cpp.h:1.8
Rev: src/program.c:1.487
Rev: src/program.h:1.181

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.486 2004/03/18 19:31:38 grubba Exp $ + || $Id: program.c,v 1.487 2004/03/23 13:41:56 grubba Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.486 2004/03/18 19:31:38 grubba Exp $"); + RCSID("$Id: program.c,v 1.487 2004/03/23 13:41:56 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
5186:    va_end(args);   }    + struct pike_string *format_exception_for_error_msg (struct svalue *thrown) + { +  struct pike_string *s = NULL; +  +  push_svalue (thrown); +  SAFE_APPLY_MASTER ("describe_error", 1); +  +  if (sp[-1].type == T_STRING) { +  f_string_trim_all_whites(1); +  push_constant_text("\n"); +  push_constant_text(" "); +  f_replace(3); +  return (--sp)->u.string; +  } +  else { +  pop_stack(); +  return NULL; +  } + } +    void yy_describe_exception(struct svalue *thrown)   {    /* FIXME: Doesn't handle wide string error messages. */