Changeset 6992
- Timestamp:
- Oct 30, 2008, 2:01:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r6937 r6992 568 568 569 569 tr_list *candidates = NULL, *l; 570 const char * tmp; 570 571 571 572 /* XDG_DATA_HOME should be the first in the list of candidates */ 572 s= getenv( "XDG_DATA_HOME" );573 if( s && *s)574 tr_list_append( &candidates, tr_strdup( s) );573 tmp = getenv( "XDG_DATA_HOME" ); 574 if( tmp && *tmp ) 575 tr_list_append( &candidates, tr_strdup( tmp ) ); 575 576 else { 576 577 char * dhome = tr_buildPath( getHomeDir( ), ".local", "share", NULL ); … … 579 580 580 581 /* XDG_DATA_DIRS are the backup directories */ 581 s = getenv( "XDG_DATA_DIRS" ); 582 if( !s || !*s ) 583 s = PACKAGE_DATA_DIR ":/usr/local/share/:/usr/share/"; 584 while( s && *s ) 585 { 586 char * end = strchr( s, ':' ); 587 if( end ) 588 { 589 tr_list_append( &candidates, tr_strndup( s, end - s ) ); 590 s = end + 1; 591 } 592 else 593 { 594 tr_list_append( &candidates, tr_strdup( s ) ); 582 tmp = getenv( "XDG_DATA_DIRS" ); 583 if( !tmp || !*tmp ) 584 tmp = PACKAGE_DATA_DIR ":/usr/local/share/:/usr/share/"; 585 while( tmp && *tmp ) { 586 const char * end = strchr( tmp, ':' ); 587 if( end ) { 588 tr_list_append( &candidates, tr_strndup( tmp, end - tmp ) ); 589 tmp = end + 1; 590 } else { 591 tr_list_append( &candidates, tr_strdup( tmp ) ); 595 592 break; 596 593 } 597 594 } 598 595 599 for( l = candidates; l; l = l->next )600 {596 /* walk through the candidates & look for a match */ 597 for( l=candidates; l; l=l->next ) { 601 598 char * path = tr_buildPath( l->data, "transmission", "web", NULL ); 602 599 const int found = isClutchDir( path );
Note: See TracChangeset
for help on using the changeset viewer.