Changeset 4437
- Timestamp:
- Jan 3, 2008, 4:01:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent-ctor.c
r4404 r4437 11 11 */ 12 12 13 #include <libgen.h> /* basename */ 13 14 #include "transmission.h" 14 15 #include "bencode.h" … … 83 84 clearMetainfo( ctor ); 84 85 err = 1; 86 } 87 88 /* if no `name' field was set, then set it from the filename */ 89 if( ctor->isSet_metainfo ) { 90 benc_val_t * info = tr_bencDictFindType( &ctor->metainfo, "info", TYPE_DICT ); 91 if( info != NULL ) { 92 benc_val_t * name = tr_bencDictFindFirst( info, "name.utf-8", "name", NULL ); 93 if( name == NULL ) 94 name = tr_bencDictAdd( info, "name" ); 95 if( name->type!=TYPE_STR || !name->val.s.s || !*name->val.s.s ) { 96 char * tmp = tr_strdup( filename ); 97 tr_bencInitStrDup( name, basename( tmp ) ); 98 tr_free( tmp ); 99 } 100 } 85 101 } 86 102
Note: See TracChangeset
for help on using the changeset viewer.