Changes in / [4ebbfbc:c36f4d0]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
refeec7f r83e023e 2165 2165 myargv[i]=argv[i]; 2166 2166 } 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 } 2169 2170 g_free(myargv); 2170 2171 return NULL; -
functions.c
r4ebbfbc r4ebbfbc 2132 2132 2133 2133 /* Create a new filter, or replace an existing one 2134 * with a new definition. 2134 * with a new definition. Returns true on success. 2135 2135 */ 2136 voidowl_function_create_filter(int argc, const char *const *argv)2136 bool owl_function_create_filter(int argc, const char *const *argv) 2137 2137 { 2138 2138 owl_filter *f; … … 2142 2142 if (argc < 2) { 2143 2143 owl_function_error("Wrong number of arguments to filter command"); 2144 return ;2144 return false; 2145 2145 } 2146 2146 … … 2152 2152 if (!strcmp(argv[1], "all")) { 2153 2153 owl_function_error("You may not change the 'all' filter."); 2154 return ;2154 return false; 2155 2155 } 2156 2156 … … 2160 2160 if (!f) { 2161 2161 owl_function_error("The filter '%s' does not exist.", argv[1]); 2162 return ;2162 return false; 2163 2163 } 2164 2164 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2165 2165 owl_function_error("The color '%s' is not available.", argv[3]); 2166 return ;2166 return false; 2167 2167 } 2168 2168 owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3])); 2169 2169 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2170 return ;2170 return false; 2171 2171 } 2172 2172 if (argc==4 && !strcmp(argv[2], "-b")) { … … 2174 2174 if (!f) { 2175 2175 owl_function_error("The filter '%s' does not exist.", argv[1]); 2176 return ;2176 return false; 2177 2177 } 2178 2178 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2179 2179 owl_function_error("The color '%s' is not available.", argv[3]); 2180 return ;2180 return false; 2181 2181 } 2182 2182 owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3])); 2183 2183 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2184 return ;2184 return true; 2185 2185 } 2186 2186 … … 2189 2189 if (f == NULL) { 2190 2190 owl_function_error("Invalid filter"); 2191 return ;2191 return false; 2192 2192 } 2193 2193 … … 2210 2210 } 2211 2211 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2212 return true; 2212 2213 } 2213 2214 -
owl.h
r67e5ba36 rc40d11a 75 75 76 76 #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 */78 77 79 78 #define OWL_FMTEXT_ATTR_NONE 0 … … 206 205 #define OWL_META(key) ((key)|010000) 207 206 /* OWL_CTRL is definied in kepress.c */ 208 209 #define LINE 2048210 207 211 208 #ifdef HAVE_LIBZEPHYR -
regex.c
rd427f08 rc40d11a 11 11 { 12 12 int ret; 13 char buff1[LINE]; 13 size_t errbuf_size; 14 char *errbuf; 14 15 const char *ptr; 15 16 … … 26 27 ret=regcomp(&(re->re), ptr, REG_EXTENDED|REG_ICASE); 27 28 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); 30 34 g_free(re->string); 31 35 re->string=NULL;
Note: See TracChangeset
for help on using the changeset viewer.