FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Masters Of The Universe

 
 
LinkBack Thread Tools
 
Old 12-06-2007, 05:07 PM
Thomas Osterried
 
Default dvgrab-3.01 for ubuntu gutsy (amd64): getopt() problem

Hello,

this report goes to
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Erik Schanze <eriks@debian.org>

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 "-stin" 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 )


--
Ubuntu-motu mailing list
Ubuntu-motu@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu
 

Thread Tools




All times are GMT. The time now is 07:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org