]> sjero.net Git - dccp2tcp/commitdiff
Allow DCCP input file to be stdin. This enables handling compressed files with, for...
authorSamuel Jero <sj323707@ohio.edu>
Sun, 27 Nov 2011 20:59:48 +0000 (15:59 -0500)
committerSamuel Jero <sj323707@ohio.edu>
Sun, 27 Nov 2011 20:59:48 +0000 (15:59 -0500)
dccp2tcp.c

index dbd90dfc39832683cacbefdefdd7202add5f7f63..672997e83fa1dbaf109124afac7a00b23b274c10 100644 (file)
@@ -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){