Changes in / [4ebbfbc:c36f4d0]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    refeec7f r83e023e  
    21652165      myargv[i]=argv[i];
    21662166    }
    2167     owl_function_create_filter(argc, myargv);
    2168     owl_function_change_currentview_filter("owl-dynamic");
     2167    if (owl_function_create_filter(argc, myargv)) {
     2168      owl_function_change_currentview_filter("owl-dynamic");
     2169    }
    21692170    g_free(myargv);
    21702171    return NULL;
  • functions.c

    r4ebbfbc r4ebbfbc  
    21322132
    21332133/* Create a new filter, or replace an existing one
    2134  * with a new definition.
     2134 * with a new definition. Returns true on success.
    21352135 */
    2136 void owl_function_create_filter(int argc, const char *const *argv)
     2136bool owl_function_create_filter(int argc, const char *const *argv)
    21372137{
    21382138  owl_filter *f;
     
    21422142  if (argc < 2) {
    21432143    owl_function_error("Wrong number of arguments to filter command");
    2144     return;
     2144    return false;
    21452145  }
    21462146
     
    21522152  if (!strcmp(argv[1], "all")) {
    21532153    owl_function_error("You may not change the 'all' filter.");
    2154     return;
     2154    return false;
    21552155  }
    21562156
     
    21602160    if (!f) {
    21612161      owl_function_error("The filter '%s' does not exist.", argv[1]);
    2162       return;
     2162      return false;
    21632163    }
    21642164    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    21652165      owl_function_error("The color '%s' is not available.", argv[3]);
    2166       return;
     2166      return false;
    21672167    }
    21682168    owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3]));
    21692169    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    2170     return;
     2170    return false;
    21712171  }
    21722172  if (argc==4 && !strcmp(argv[2], "-b")) {
     
    21742174    if (!f) {
    21752175      owl_function_error("The filter '%s' does not exist.", argv[1]);
    2176       return;
     2176      return false;
    21772177    }
    21782178    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    21792179      owl_function_error("The color '%s' is not available.", argv[3]);
    2180       return;
     2180      return false;
    21812181    }
    21822182    owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3]));
    21832183    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    2184     return;
     2184    return true;
    21852185  }
    21862186
     
    21892189  if (f == NULL) {
    21902190    owl_function_error("Invalid filter");
    2191     return;
     2191    return false;
    21922192  }
    21932193
     
    22102210  }
    22112211  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     2212  return true;
    22122213}
    22132214
  • owl.h

    r67e5ba36 rc40d11a  
    7575
    7676#define OWL_CONFIG_DIR "/.owl"             /* this is relative to the user's home directory */
    77 #define OWL_STARTUP_FILE "/.owl/startup"   /* this is relative to the user's home directory */
    7877
    7978#define OWL_FMTEXT_ATTR_NONE      0
     
    206205#define OWL_META(key) ((key)|010000)
    207206/* OWL_CTRL is definied in kepress.c */
    208 
    209 #define LINE 2048
    210207
    211208#ifdef HAVE_LIBZEPHYR
  • regex.c

    rd427f08 rc40d11a  
    1111{
    1212  int ret;
    13   char buff1[LINE];
     13  size_t errbuf_size;
     14  char *errbuf;
    1415  const char *ptr;
    1516 
     
    2627  ret=regcomp(&(re->re), ptr, REG_EXTENDED|REG_ICASE);
    2728  if (ret) {
    28     regerror(ret, NULL, buff1, LINE);
    29     owl_function_makemsg("Error in regular expression: %s", buff1);
     29    errbuf_size = regerror(ret, NULL, NULL, 0);
     30    errbuf = g_new(char, errbuf_size);
     31    regerror(ret, NULL, errbuf, errbuf_size);
     32    owl_function_error("Error in regular expression: %s", errbuf);
     33    g_free(errbuf);
    3034    g_free(re->string);
    3135    re->string=NULL;
Note: See TracChangeset for help on using the changeset viewer.