Changeset 83e023e
- Timestamp:
- Jul 23, 2011, 7:22:12 PM (14 years ago)
- Children:
- c40d11a
- Parents:
- e9a939b
- git-author:
- David Benjamin <davidben@mit.edu> (07/23/11 18:54:46)
- git-committer:
- David Benjamin <davidben@mit.edu> (07/23/11 19:22:12)
- Files:
-
- 2 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
r6500907 r83e023e 2126 2126 2127 2127 /* Create a new filter, or replace an existing one 2128 * with a new definition. 2128 * with a new definition. Returns true on success. 2129 2129 */ 2130 voidowl_function_create_filter(int argc, const char *const *argv)2130 bool owl_function_create_filter(int argc, const char *const *argv) 2131 2131 { 2132 2132 owl_filter *f; … … 2136 2136 if (argc < 2) { 2137 2137 owl_function_error("Wrong number of arguments to filter command"); 2138 return ;2138 return false; 2139 2139 } 2140 2140 … … 2146 2146 if (!strcmp(argv[1], "all")) { 2147 2147 owl_function_error("You may not change the 'all' filter."); 2148 return ;2148 return false; 2149 2149 } 2150 2150 … … 2154 2154 if (!f) { 2155 2155 owl_function_error("The filter '%s' does not exist.", argv[1]); 2156 return ;2156 return false; 2157 2157 } 2158 2158 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2159 2159 owl_function_error("The color '%s' is not available.", argv[3]); 2160 return ;2160 return false; 2161 2161 } 2162 2162 owl_filter_set_fgcolor(f, owl_util_string_to_color(argv[3])); 2163 2163 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2164 return ;2164 return false; 2165 2165 } 2166 2166 if (argc==4 && !strcmp(argv[2], "-b")) { … … 2168 2168 if (!f) { 2169 2169 owl_function_error("The filter '%s' does not exist.", argv[1]); 2170 return ;2170 return false; 2171 2171 } 2172 2172 if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) { 2173 2173 owl_function_error("The color '%s' is not available.", argv[3]); 2174 return ;2174 return false; 2175 2175 } 2176 2176 owl_filter_set_bgcolor(f, owl_util_string_to_color(argv[3])); 2177 2177 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2178 return ;2178 return true; 2179 2179 } 2180 2180 … … 2183 2183 if (f == NULL) { 2184 2184 owl_function_error("Invalid filter"); 2185 return ;2185 return false; 2186 2186 } 2187 2187 … … 2204 2204 } 2205 2205 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 2206 return true; 2206 2207 } 2207 2208
Note: See TracChangeset
for help on using the changeset viewer.