From a902acb03c9b7071f90d052c30074442cfca45c5 Mon Sep 17 00:00:00 2001 From: Samuel Jero Date: Sun, 27 Nov 2011 15:59:48 -0500 Subject: [PATCH] Allow DCCP input file to be stdin. This enables handling compressed files with, for example, zcat. --- dccp2tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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){ -- 2.39.2