Changeset 7372 for branches/1.4x/libtransmission/platform.c
- Timestamp:
- Dec 14, 2008, 1:19:49 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4x/libtransmission/platform.c
r7019 r7372 103 103 return tr_areThreadsEqual( tr_getCurrentThread( ), t->thread ); 104 104 } 105 106 #include <event.h> 105 107 106 108 #ifdef WIN32 … … 583 585 584 586 /* XDG_DATA_DIRS are the backup directories */ 585 tmp = getenv( "XDG_DATA_DIRS" ); 586 if( !tmp || !*tmp ) 587 tmp = PACKAGE_DATA_DIR ":/usr/local/share/:/usr/share/"; 588 while( tmp && *tmp ) { 589 const char * end = strchr( tmp, ':' ); 590 if( end ) { 591 tr_list_append( &candidates, tr_strndup( tmp, end - tmp ) ); 592 tmp = end + 1; 593 } else { 594 tr_list_append( &candidates, tr_strdup( tmp ) ); 595 break; 587 { 588 struct evbuffer * buf = evbuffer_new( ); 589 evbuffer_add_printf( buf, "%s:", PACKAGE_DATA_DIR ); 590 if(( tmp = getenv( "XDG_DATA_DIRS" ))) 591 evbuffer_add_printf( buf, "%s:", tmp ); 592 evbuffer_add_printf( buf, "%s:", "/usr/local/share" ); 593 evbuffer_add_printf( buf, "%s:", "/usr/share" ); 594 tmp = (const char*) EVBUFFER_DATA( buf ); 595 while( tmp && *tmp ) { 596 const char * end = strchr( tmp, ':' ); 597 if( end ) { 598 tr_list_append( &candidates, tr_strndup( tmp, end - tmp ) ); 599 tmp = end + 1; 600 } else if( tmp && *tmp ) { 601 tr_list_append( &candidates, tr_strdup( tmp ) ); 602 break; 603 } 596 604 } 605 evbuffer_free( buf ); 597 606 } 598 607
Note: See TracChangeset
for help on using the changeset viewer.