fix trailing combining characters in all shf functions
This commit is contained in:
		
							
								
								
									
										12
									
								
								shf.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								shf.c
									
									
									
									
									
								
							| @@ -25,7 +25,7 @@ | |||||||
|  |  | ||||||
| #include "sh.h" | #include "sh.h" | ||||||
|  |  | ||||||
| __RCSID("$MirOS: src/bin/mksh/shf.c,v 1.71 2016/05/05 21:29:24 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/shf.c,v 1.72 2016/05/05 21:38:12 tg Exp $"); | ||||||
|  |  | ||||||
| /* flags to shf_emptybuf() */ | /* flags to shf_emptybuf() */ | ||||||
| #define EB_READSW	0x01	/* about to switch to reading */ | #define EB_READSW	0x01	/* about to switch to reading */ | ||||||
| @@ -1040,15 +1040,11 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args) | |||||||
| 		} else | 		} else | ||||||
| 			field = 0; | 			field = 0; | ||||||
|  |  | ||||||
| 		if (precision) { |  | ||||||
| 			const char *q; |  | ||||||
|  |  | ||||||
| 		nwritten += precision; | 		nwritten += precision; | ||||||
| 			q = utf_skipcols(s, precision); | 		precision = utf_skipcols(s, precision) - s; | ||||||
| 			while (s < q) { | 		while (precision--) | ||||||
| 			shf_putc(*s++, shf); | 			shf_putc(*s++, shf); | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		nwritten += field; | 		nwritten += field; | ||||||
| 		while (field--) | 		while (field--) | ||||||
| 			shf_putc(c, shf); | 			shf_putc(c, shf); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user