Changeset 7373 for trunk/libtransmission/platform.c
- Timestamp:
- Dec 14, 2008, 1:19:50 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r7367 r7373 10 10 * $Id$ 11 11 */ 12 13 #include <event.h> 12 14 13 15 #ifdef WIN32 … … 553 555 554 556 /* XDG_DATA_DIRS are the backup directories */ 555 tmp = getenv( "XDG_DATA_DIRS" ); 556 if( !tmp || !*tmp ) 557 tmp = PACKAGE_DATA_DIR ":/usr/local/share/:/usr/share/"; 558 while( tmp && *tmp ) { 559 const char * end = strchr( tmp, ':' ); 560 if( end ) { 561 tr_list_append( &candidates, tr_strndup( tmp, end - tmp ) ); 562 tmp = end + 1; 563 } else { 564 tr_list_append( &candidates, tr_strdup( tmp ) ); 565 break; 557 { 558 struct evbuffer * buf = evbuffer_new( ); 559 evbuffer_add_printf( buf, "%s:", PACKAGE_DATA_DIR ); 560 if(( tmp = getenv( "XDG_DATA_DIRS" ))) 561 evbuffer_add_printf( buf, "%s:", tmp ); 562 evbuffer_add_printf( buf, "%s:", "/usr/local/share" ); 563 evbuffer_add_printf( buf, "%s:", "/usr/share" ); 564 tmp = (const char*) EVBUFFER_DATA( buf ); 565 while( tmp && *tmp ) { 566 const char * end = strchr( tmp, ':' ); 567 if( end ) { 568 tr_list_append( &candidates, tr_strndup( tmp, end - tmp ) ); 569 tmp = end + 1; 570 } else if( tmp && *tmp ) { 571 tr_list_append( &candidates, tr_strdup( tmp ) ); 572 break; 573 } 566 574 } 575 evbuffer_free( buf ); 567 576 } 568 577
Note: See TracChangeset
for help on using the changeset viewer.