Changeset 6307


Ignore:
Timestamp:
Jul 9, 2008, 3:39:53 PM (13 years ago)
Author:
charles
Message:

(libT) let tr_getopt() support short options' arguments to be embedded, such as -p51413

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/cli.c

    r6306 r6307  
    240240    }
    241241    if( peerPort < 1 || peerPort > 65535 ) {
    242         printf( "Invalid port '%d'\n", peerPort );
     242        printf( "Error: Port must between 1 and 65535; got %d\n", peerPort );
    243243        return EXIT_FAILURE;
    244244    }
    245245    if( peerSocketTOS < 0 || peerSocketTOS > 255 ) {
    246         printf( "Invalid TOS '%d'\n", peerSocketTOS );
     246        printf( "Error: Port must between 0 and 255; got %d\n", peerSocketTOS );
    247247        return EXIT_FAILURE;
    248248    }
     
    393393        if( gotsig ) {
    394394            gotsig = 0;
    395             printf( "stopping torrent...\n" );
     395            printf( "\nStopping torrent...\n" );
    396396            tr_torrentStop( tor );
    397397        }
  • trunk/libtransmission/tr-getopt.c

    r6306 r6307  
    137137            }
    138138            len = strlen( o->shortName );
    139             if( !memcmp( o->shortName, str+1, len ) && str[len+1]=='=' ) {
    140                 if( nested ) *nested = str+len+2;
     139            if( !memcmp( o->shortName, str+1, len ) ) {
     140                if( nested )
     141                    *nested = str[len+1]=='=' ? str+len+2 : str+len+1;
    141142                return o;
    142143            }
Note: See TracChangeset for help on using the changeset viewer.