Changeset bd8b991


Ignore:
Timestamp:
Dec 20, 2008, 10:17:35 PM (16 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e2a620b
Parents:
924f7cd
Message:
Turn multi-line error messages into admin messages.

This should help a lot with helping users debug perl modules and the
like; The previous behavior of just showing one line was pretty much
useless.

We may still want to go through and replace some calls to
owl_function_error with owl_function_adminmsg and vice versa.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8e5935d rbd8b991  
    34373437{
    34383438  va_list ap;
    3439   char buff[2048], buff2[2048];
     3439  char *buff, *buff2;
     3440  char *nl;
    34403441  char *date;
    34413442  time_t now;
     
    34473448  va_start(ap, fmt);
    34483449
    3449   vsnprintf(buff, 2048, fmt, ap);
    3450   sprintf(buff2, "%s %s", date, buff);
     3450  buff = g_strdup_vprintf(fmt, ap);
     3451  buff2 = owl_sprintf("%s %s", date, buff);
    34513452  owl_function_debugmsg("ERROR: %s", buff);
    3452   if (owl_global_get_curs_msgwin(&g)) {
    3453     werase(owl_global_get_curs_msgwin(&g));
    3454     waddstr(owl_global_get_curs_msgwin(&g), buff); 
    3455     wnoutrefresh(owl_global_get_curs_msgwin(&g));
    3456     owl_global_set_needrefresh(&g);
     3453  nl = strchr(buff, '\n');
     3454  if(nl && *(nl + 1)) {
     3455    /* Multiline error */
     3456    owl_function_adminmsg("ERROR", buff);
     3457  } else {
     3458    owl_function_makemsg("%s", buff2);
    34573459  }
    34583460  owl_errqueue_append_err(owl_global_get_errqueue(&g), buff2);
    34593461  va_end(ap);
    34603462  owl_free(date);
     3463  owl_free(buff);
     3464  owl_free(buff2);
    34613465}
    34623466
Note: See TracChangeset for help on using the changeset viewer.