Changeset b40e60d
- Timestamp:
- 2010-07-29T08:57:01Z (14 years ago)
- Branches:
- master
- Children:
- 2fe5eb9
- Parents:
- 3963fdd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
r3963fdd rb40e60d 305 305 for( i = j = 0; t[i]; i ++, j ++ ) 306 306 { 307 if( !isalnum( t[i] ) && !strchr( "._-~", t[i] ) ) 307 /* Warning: isalnum() is locale-aware, so don't use it here! */ 308 if( ( t[i] >= 'A' && t[i] <= 'Z' ) || 309 ( t[i] >= 'a' && t[i] <= 'z' ) || 310 ( t[i] >= '0' && t[i] <= '9' ) || 311 strchr( "._-~", t[i] ) ) 312 { 313 s[j] = t[i]; 314 } 315 else 308 316 { 309 317 sprintf( s + j, "%%%02X", ((unsigned char*)t)[i] ); 310 318 j += 2; 311 }312 else313 {314 s[j] = t[i];315 319 } 316 320 } -
tests/check.c
r3963fdd rb40e60d 3 3 #include <gmodule.h> 4 4 #include <check.h> 5 #include <locale.h> 5 6 #include "bitlbee.h" 6 7 #include "testsuite.h" … … 92 93 93 94 log_init(); 95 setlocale(LC_CTYPE, ""); 94 96 95 97 if (verbose) { -
tests/check_util.c
r3963fdd rb40e60d 161 161 END_TEST 162 162 163 START_TEST(test_http_encode) 164 char s[80]; 165 166 strcpy( s, "ee\xc3""\xab""ee!!..." ); 167 http_encode( s ); 168 fail_unless( strcmp( s, "ee%C3%ABee%21%21..." ) == 0 ); 169 END_TEST 170 163 171 Suite *util_suite (void) 164 172 { … … 174 182 tcase_add_test (tc_core, test_set_url_username_pwd); 175 183 tcase_add_test (tc_core, test_word_wrap); 184 tcase_add_test (tc_core, test_http_encode); 176 185 return s; 177 186 }
Note: See TracChangeset
for help on using the changeset viewer.