From: Samuel Jero Date: Sun, 27 Nov 2011 20:59:48 +0000 (-0500) Subject: Allow DCCP input file to be stdin. This enables handling compressed files with, for... X-Git-Url: http://sjero.net/git/?p=dccp2tcp;a=commitdiff_plain;h=a902acb03c9b7071f90d052c30074442cfca45c5 Allow DCCP input file to be stdin. This enables handling compressed files with, for example, zcat. --- diff --git a/dccp2tcp.c b/dccp2tcp.c index dbd90df..672997e 100644 --- a/dccp2tcp.c +++ b/dccp2tcp.c @@ -56,8 +56,9 @@ int main(int argc, char *argv[]) /*loop through commandline options*/ for(int i=1; i < argc; i++){ - if(argv[i][0]!='-'){ - if(dfile==NULL){ /*assign first non-dash argument to the dccp file*/ + if(argv[i][0]!='-' || (argv[i][0]=='-' && strlen(argv[i])==1)){ + if(dfile==NULL || argv[i][0]=='-'){ + /*assign first non-dash (or only dash) argument to the dccp file*/ dfile=argv[i]; }else{ if(tfile==NULL){