Changeset 5310
- Timestamp:
- 02/24/08 11:21:16 (4 months ago)
- Files:
-
- libwired/trunk/libwired/data/wi-string.c (modified) (3 diffs)
- libwired/trunk/libwired/data/wi-string.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libwired/trunk/libwired/data/wi-string.c
r5262 r5310 752 752 #pragma mark - 753 753 754 void wi_string_set_ string(wi_string_t *string, wi_string_t *otherstring) {755 if(string->string != other string->string) {754 void wi_string_set_cstring(wi_string_t *string, const char *othercstring) { 755 if(string->string != othercstring) { 756 756 string->string[0] = '\0'; 757 757 string->length = 0; 758 758 759 wi_string_append_cstring(string, otherstring->string); 760 } 759 wi_string_append_cstring(string, othercstring); 760 } 761 } 762 763 764 765 void wi_string_set_string(wi_string_t *string, wi_string_t *otherstring) { 766 wi_string_set_cstring(string, otherstring->string); 761 767 } 762 768 … … 1305 1311 char *p, *pp, *ap; 1306 1312 1307 p = p p = strdup(path->string);1308 1309 while((ap = wi_strsep(&p p, "/"))) {1313 p = path->string; 1314 1315 while((ap = wi_strsep(&p, "/"))) { 1310 1316 if(ap[0]) { 1311 1317 wi_strlcat(fullpath, "/", sizeof(fullpath)); … … 1316 1322 } 1317 1323 1318 free(p); 1319 1320 if(strlen(fullpath) > 0 && strcmp(path->string, fullpath) != 0) { 1321 string = wi_string_init_with_cstring(wi_string_alloc(), fullpath); 1322 wi_string_set_string(path, string); 1323 wi_release(string); 1324 } 1324 wi_string_set_cstring(path, fullpath); 1325 1325 #endif 1326 1326 } libwired/trunk/libwired/data/wi-string.h
r5063 r5310 85 85 WI_EXPORT wi_string_t * _wi_string_constant_string(const char *); 86 86 87 WI_EXPORT void wi_string_set_cstring(wi_string_t *, const char *); 87 88 WI_EXPORT void wi_string_set_string(wi_string_t *, wi_string_t *); 88 89 WI_EXPORT void wi_string_set_format(wi_string_t *, wi_string_t *, ...);
