Public bug reported:

Binary package hint: dvgrab

dvgrab's commandline option "-" tells that the grabed shout go to stdout.       
getopt_long_only() on my system does not honour the "-"-only option, specified  
with char *opts = "d:hif:F:I:s:tVv-". At the point, "-" is evaluated,           
the while loop terminates, and "-" is interpreted as filename, which results    
in files like "-001.avi".                                                       
                                                                                
The patch below fixes the problem.                                              

Generally, "-" may lead to misunderstandings: is it meant for stdin or          
stdout.. - one has to look at the doku.                                         
dvgrab has "-I -" or "-stdin" for reading from stdin, and perhaps it            
 
would be wise to be consequent and to also provide "-O -" and "-stdout"         
for the stdout case. Thus, if getopt() on a system is broken, the user          
would have still a chance to grab to stdout without the need of recompile ;)    
                                                                                
Regards,                                                                        
        - Thomas                                                                
                                                                                
Appendix: fix for grabing to stdout on ubuntu gutsy amd64                       
---------------------------------------------------------                       
                                                                                
diff -Naur dvgrab-3.0/dvgrab.cc.orig dvgrab-3.0/dvgrab.cc                       
--- dvgrab-3.0/dvgrab.cc.orig   2007-08-07 05:00:43.000000000 +0200             
+++ dvgrab-3.0/dvgrab.cc        2007-12-06 18:55:58.000000000 +0100             
@@ -447,8 +447,14 @@                                                            
                                                                                
        if ( optind < argc )                                                    
        {                                                                       
-               m_dst_file_name = argv[ optind++ ];                             
-               set_format_from_name();                                         
+               /* option "-" not evaluated above. getopt_long_only() compat 
issue? */                                                                      
+               if (!strcmp(argv[ optind ], "-")) {                             
+                       m_raw_pipe = true;                                      
+                       optind++;                                               
+               } else {                                                        
+                       m_dst_file_name = argv[ optind++ ];                     
+                       set_format_from_name();                                 
+               }                                                               
        }                                                                       
                                                                                
        if ( optind < argc )

** Affects: dvgrab (Ubuntu)
     Importance: Undecided
         Status: New

-- 
dvgrab-3.01 for ubuntu gutsy (amd64): getopt() problem
https://bugs.launchpad.net/bugs/176389
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to