@@ -235,6 +235,27 @@ static int exclude_formats(char *rej_format, struct fmt_main **full_fmt_list)
235235 return removed ;
236236}
237237
238+ /* Exclusions. Drop all format(s) up to and including the matching rej_format from full list */
239+ static int exclude_formats_up_to (char * rej_format , struct fmt_main * * full_fmt_list )
240+ {
241+ static int drop = 1 ;
242+ struct fmt_main * current ;
243+ int removed = 0 ;
244+
245+ if ((current = * full_fmt_list ))
246+ do {
247+ if (drop ) {
248+ if (fmt_match (rej_format , current , 1 ))
249+ drop = 0 ;
250+ * full_fmt_list = current -> next ;
251+ removed ++ ;
252+ } else
253+ break ;
254+ } while ((current = current -> next ));
255+
256+ return removed ;
257+ }
258+
238259/* Inclusions. Move any format(s) matching req_format from full list to new list */
239260static int include_formats (char * req_format , struct fmt_main * * full_fmt_list )
240261{
@@ -329,7 +350,7 @@ static void comma_split(struct list_main *dst, const char *src)
329350
330351char * fmt_type (char * name )
331352{
332- if (name [1 ] && (name [0 ] == '+' || name [0 ] == '-' ))
353+ if (name [1 ] && (name [0 ] == '+' || name [0 ] == '-' || name [ 0 ] == '/' ))
333354 name ++ ;
334355
335356 if (fmt_is_class (name ))
@@ -357,9 +378,16 @@ int fmt_check_custom_list(void)
357378 fmt_list = NULL ;
358379 fmt_tail = & fmt_list ;
359380
360- /* "-" Exclusions first, from the full list. */
381+ /* "-" or "/" Exclusions first, from the full list. */
361382 do {
362- if (req_format -> data [0 ] == '-' ) {
383+ if (req_format -> data [0 ] == '/' ) {
384+ char * exclude_fmt = & (req_format -> data [1 ]);
385+
386+ if (!exclude_fmt [0 ])
387+ error_msg ("Error: '%s' in format list doesn't make sense\n" , req_format -> data );
388+ num_e += exclude_formats_up_to (exclude_fmt , & full_fmt_list );
389+ }
390+ else if (req_format -> data [0 ] == '-' ) {
363391 char * exclude_fmt = & (req_format -> data [1 ]);
364392
365393 if (!exclude_fmt [0 ])
@@ -371,7 +399,7 @@ int fmt_check_custom_list(void)
371399 /* Inclusions. Move to the new list. */
372400 req_format = req_formats -> head ;
373401 do {
374- if ((req_format -> data [0 ] != '-' ) && (req_format -> data [0 ] != '+' )) {
402+ if ((req_format -> data [0 ] != '-' ) && (req_format -> data [0 ] != '+' ) && ( req_format -> data [ 0 ] != '/' ) ) {
375403 had_i = 1 ;
376404 if (!include_formats (req_format -> data , & full_fmt_list ) && !is_in_fmt_list (req_format -> data )) {
377405 if (john_main_process )
0 commit comments