Changeset 1044
- Timestamp:
- 07/10/07 13:15:46 (1 year ago)
- Files:
-
- 1.8.3/trunk/src/funcrypt.c (modified) (3 diffs)
- 1.8.3/trunk/src/tables.c (modified) (2 diffs)
- 1.8.3/trunk/utils/gentables.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/trunk/src/funcrypt.c
r1032 r1044 87 87 } 88 88 89 extern char valid_ansi_codes[UCHAR_MAX + 1]; 90 89 91 static bool 90 92 decode_base64(char *encoded, int len, char *buff, char **bp) … … 92 94 #ifdef HAVE_SSL 93 95 BIO *bio, *b64, *bmem; 94 char *s tart, *sbp;96 char *sbp; 95 97 96 98 b64 = BIO_new(BIO_f_base64()); … … 111 113 bio = BIO_push(b64, bmem); 112 114 113 start = buff;114 115 sbp = *bp; 115 116 while (true) { 116 117 char decoded[BUFFER_LEN]; 117 118 int dlen; 119 118 120 dlen = BIO_read(bio, decoded, BUFFER_LEN); 119 if (dlen > 0) 121 if (dlen > 0) { 122 int n; 123 for (n = 0; n < dlen; n++) { 124 if (decoded[n] == TAG_START) { 125 int end; 126 n += 1; 127 for (end = n; end < dlen; end++) { 128 if (decoded[end] == TAG_END) 129 break; 130 } 131 if (end == dlen || decoded[n] != MARKUP_COLOR) { 132 BIO_free_all(bio); 133 *bp = sbp; 134 safe_str(T("#-1 CONVERSION ERROR"), buff, bp); 135 return false; 136 } 137 for (; n < end; n++) { 138 if (!valid_ansi_codes[(unsigned char) decoded[n]]) { 139 BIO_free_all(bio); 140 *bp = sbp; 141 safe_str(T("#-1 CONVERSION ERROR"), buff, bp); 142 return false; 143 } 144 } 145 n = end; 146 } else if (!isprint((unsigned char) decoded[n])) 147 decoded[n] = '?'; 148 } 120 149 safe_strl(decoded, dlen, buff, bp); 121 else if (dlen == 0)150 } else if (dlen == 0) 122 151 break; 123 152 else { 124 buff = start;125 153 *bp = sbp; 126 154 safe_str(T("#-1 CONVERSION ERROR"), buff, bp); 1.8.3/trunk/src/tables.c
r463 r1044 1 /* This file was generated by running ./ gentablescompiled from1 /* This file was generated by running ./a.out compiled from 2 2 * utils/gentables.c. Edit that file, not this one, when making changes. */ 3 3 #include <stdlib.h> … … 88 88 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89 89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 90 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 98 }; 99 100 char valid_ansi_codes[256] = { 101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 106 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 107 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 108 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 90 109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91 110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.8.3/trunk/utils/gentables.c
r846 r1044 107 107 }; 108 108 109 110 /* Color codes used in ansi markup */ 111 char ansi_codes[UCHAR_MAX + 1] = { 112 ['h'] = 1, ['i'] = 1, ['f'] = 1, ['u'] = 1, ['n'] = 1, 113 ['x'] = 1, ['r'] = 1, ['g'] = 1, ['y'] = 1, ['b'] = 1, 114 ['c'] = 1, ['m'] = 1, ['w'] = 1, 115 ['X'] = 1, ['R'] = 1, ['G'] = 1, ['Y'] = 1, ['B'] = 1, 116 ['C'] = 1, ['M'] = 1, ['W'] = 1, 117 ['/'] = 1, ['a'] = 1 118 }; 109 119 110 120 /** Accented characters … … 266 276 print_table_bool("char", "valid_timefmt_codes", valid_timefmt_codes, 0); 267 277 print_table_bool("char", "escaped_chars", escaped_chars, 0); 278 print_table_bool("char", "valid_ansi_codes", ansi_codes, 0); 268 279 print_entity_table("accent_table", entity_table); 269 280 return EXIT_SUCCESS;
