Georgi Chorbadzhiyski <[email protected]> writes: > On 10/4/11 10:01 PM, Anton Khirnov wrote: >>> -void show_banner(void) >>> +void show_banner(int argc, char **argv) >>> { >>> + char *params; >>> + int i, argv_len = 0; >>> + >>> + for (i=1; i<argc; i++) >>> + argv_len += strlen(argv[i]); >>> + >>> + params = av_mallocz(argv_len + argc + 1); >>> + for (i=1; i<argc; i++) { >>> + strcat(params, argv[i]); >>> + strcat(params, " "); >>> + } >>> + if (strlen(params)) >>> + params[strlen(params)-1] = '\0'; >>> + >> >> Why all the copying? Why don't you just print them directly? > > Umm...brain fart on my side. You are obviously correct, see the attached. > > -- > Georgi Chorbadzhiyski > http://georgi.unixsol.org/ > From 432acf9a78cb424374509a7b2fc75e08ba0eb615 Mon Sep 17 00:00:00 2001 > From: Georgi Chorbadzhiyski <[email protected]> > Date: Tue, 4 Oct 2011 15:45:22 +0300 > Subject: [PATCH] Print command line parameters in show_banner(). > > When requesting debug info the user is already instructed to > copy the full program output but in addition to that it needs > to provide how the program was called. With this change all > command line parameters that are used are shown in the output > when verbose output is enabled.
Are users now assumed too stupid to copy the command line they typed, yet somehow capable of copying the same thing printed by the program. Besides, printing it from within the program requires careful quoting to make sure arguments containing whitespace or quotes are unambiguously printed. I really don't think it's worth the effort. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
