Changeset 256
- Timestamp:
- 06/15/11 18:05:37 (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r255 r256 1190 1190 ? REGFI_ENCODING_ASCII : REGFI_ENCODING_UTF16LE; 1191 1191 1192 if(vk->name_length == 0) 1193 return; 1194 1192 1195 if(from_encoding == output_encoding) 1193 1196 { … … 1280 1283 REGFI_ENCODING from_encoding = (nk->flags & REGFI_NK_FLAG_ASCIINAME) 1281 1284 ? REGFI_ENCODING_ASCII : REGFI_ENCODING_UTF16LE; 1282 1285 1286 if(nk->name_length == 0) 1287 return; 1288 1283 1289 if(from_encoding == output_encoding) 1284 1290 { … … 2345 2351 bool found = false; 2346 2352 2347 /* XXX: cur->name can be NULL in the registry.2348 * Should we allow for a way to search for that?2353 /* XXX: should we allow "(default)" subkey names? 2354 * Do realistically they exist? 2349 2355 */ 2350 2356 if(name == NULL) … … 2357 2363 return false; 2358 2364 2359 if((cur->name != NULL)2360 2365 /* A NULL name signifies the "(default)" value for a key */ 2366 if(cur->name != NULL && (strcasecmp(cur->name, name) == 0)) 2361 2367 { 2362 2368 found = true; … … 2382 2388 bool found = false; 2383 2389 2384 /* XXX: cur->name can be NULL in the registry.2385 * Should we allow for a way to search for that?2386 */2387 if(name == NULL)2388 return false;2389 2390 2390 for(i=0; (i < num_values) && (found == false); i++) 2391 2391 { … … 2394 2394 return false; 2395 2395 2396 if((cur->name != NULL) 2397 && (strcasecmp(cur->name, name) == 0)) 2396 /* A NULL name signifies the "(default)" value for a key */ 2397 if(((name == NULL) && (cur->name == NULL)) 2398 || ((name != NULL) && (cur->name != NULL) 2399 && (strcasecmp(cur->name, name) == 0))) 2398 2400 { 2399 2401 found = true; -
trunk/pyregfi-distutils.py
r212 r256 2 2 3 3 from distutils.core import setup 4 setup(name='pyregfi', version=' 0.1', package_dir={'':'python'}, packages=['pyregfi'])4 setup(name='pyregfi', version='1.0', package_dir={'':'python'}, packages=['pyregfi']) -
trunk/python/pyregfi/__init__.py
r255 r256 509 509 510 510 elif name == "modified": 511 ret_val = regfi.regfi_nt2unix_time( byref(self._base.contents.mtime))511 ret_val = regfi.regfi_nt2unix_time(self._base.contents.mtime) 512 512 513 513 else: … … 764 764 765 765 elif name == "modified": 766 return regfi.regfi_nt2unix_time( byref(self._base.contents.mtime))766 return regfi.regfi_nt2unix_time(self._base.contents.mtime) 767 767 768 768 return getattr(self.file.contents, name) -
trunk/python/pyregfi/structures.py
r255 r256 279 279 280 280 regfi.regfi_find_value.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_NK), 281 281 c_char_p, POINTER(c_uint32)] 282 282 regfi.regfi_find_value.restype = c_bool 283 283 … … 287 287 288 288 regfi.regfi_get_value.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_NK), 289 289 c_uint32] 290 290 regfi.regfi_get_value.restype = POINTER(REGFI_VK) 291 291 -
trunk/src/common.c
r251 r256 25 25 iconv_t conv_desc; 26 26 27 const char* key_special_chars = ",\" \\/";28 const char* subfield_special_chars = ",\" \\|";29 const char* common_special_chars = ",\" \\";27 const char* key_special_chars = ",\"/"; 28 const char* subfield_special_chars = ",\"|"; 29 const char* common_special_chars = ",\""; 30 30 31 31 #define REGLOOKUP_EXIT_OK 0 … … 70 70 /* Returns a newly malloc()ed string which contains original buffer, 71 71 * except for non-printable or special characters are quoted in hex 72 * with the syntax ' \xQQ' where QQ is the hex ascii value of the quoted72 * with the syntax '%QQ' where QQ is the hex ascii value of the quoted 73 73 * character. A null terminator is added, since only ascii, not binary, 74 74 * is returned. … … 119 119 } 120 120 121 if(str[i] < 32 || str[i] > 126 || strchr(special, str[i]) != NULL) 121 if(str[i] < 32 || str[i] > 126 122 || str[i] == '%' || strchr(special, str[i]) != NULL) 122 123 { 123 124 num_written += snprintf(ret_val + num_written, buf_len - num_written, 124 " \\x%.2X", str[i]);125 "%%%.2X", str[i]); 125 126 } 126 127 else … … 135 136 /* Returns a newly malloc()ed string which contains original string, 136 137 * except for non-printable or special characters are quoted in hex 137 * with the syntax ' \xQQ' where QQ is the hex ascii value of the quoted138 * with the syntax '%QQ' where QQ is the hex ascii value of the quoted 138 139 * character. 139 140 */
Note: See TracChangeset
for help on using the changeset viewer.