Interpret '%%' as literal '%' in format
This commit is contained in:
		
							parent
							
								
									ab9bf55892
								
							
						
					
					
						commit
						4b7f656f6e
					
				| @ -324,6 +324,8 @@ equivalent notification attribute. | ||||
| 
 | ||||
| =item B<%n>  progress value without any extra characters | ||||
| 
 | ||||
| =item B<%%>  Literal % | ||||
| 
 | ||||
| =back | ||||
| 
 | ||||
| If any of these exists in the format but hasn't been specified in the | ||||
|  | ||||
							
								
								
									
										1
									
								
								dunstrc
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								dunstrc
									
									
									
									
									
								
							| @ -123,6 +123,7 @@ | ||||
|     #   %I  iconname (without its path) | ||||
|     #   %p  progress value if set ([  0%] to [100%]) or nothing | ||||
|     #   %n  progress value if set without any extra characters | ||||
|     #   %%  Literal % | ||||
|     # Markup is allowed | ||||
|     format = "<b>%s</b>\n%b" | ||||
| 
 | ||||
|  | ||||
| @ -387,6 +387,13 @@ int notification_init(notification *n, int id) | ||||
|                                                 n->progress ? pg : "", | ||||
|                                                 MARKUP_NO); | ||||
|                                 break; | ||||
|                         case '%': | ||||
|                                 n->msg = notification_replace_single_field( | ||||
|                                                 n->msg, | ||||
|                                                 &substr, | ||||
|                                                 "%", | ||||
|                                                 MARKUP_NO); | ||||
|                                 break; | ||||
|                         case '\0': | ||||
|                                 fprintf(stderr, "WARNING: format_string has trailing %% character." | ||||
|                                                 "To escape it use %%%%."); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Benedikt Heine
						Benedikt Heine