Control: tags 1017147 + patch Control: tags 1017147 + pending Dear maintainer,
I've prepared an NMU for quvi (versioned as 0.9.5-0.1) and uploaded it to DELAYED/7. Please feel free to tell me if I should delay it longer. Regards. diff -Nru quvi-0.9.4/ChangeLog quvi-0.9.5/ChangeLog --- quvi-0.9.4/ChangeLog 2013-10-05 05:34:15.000000000 -0400 +++ quvi-0.9.5/ChangeLog 2013-11-10 03:01:15.000000000 -0500 @@ -1,3 +1,109 @@ +commit ebc2cd0 +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-11-10 + + Update NEWS for v0.9.5 + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +NEWS + +commit 5e2675a +Merge: d796a73 6b67bfb +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-20 + + Merge branch 'tg/next__redo_linput' into next + +commit 6b67bfb +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-20 + + DOC: input: Add file URI note + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +doc/man1/input.txt + +commit 8dfc090 +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-17 + + lutil_parse_input: Check linput_new return value + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +src/util/input.c + +commit d92133c +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-17 + + linput: Rewrite input parsing completely + + * FIX (memory leak): Release the GIOChannel created for the stdin + by decrementing the reference count of the <stdin> GIOChannel + + * Do not unescape input URLs + - This was previously done because quvi-dump shamelessly escaped the + URLs completely (incl. the "reserved chars") and g_uri_parse_scheme, + which linput calls (to determine the action it should take with the + input URL), couldn't parse the escaped URI schemes otherwise + + - Any normal applications leave the "reserved chars" unescaped, e.g. + the web browsers + + * linput_new now returns an integer, indicating the success + - Program now exits if input parsing failed (e.g. invalid URI) + + * Follow file URIs + - Making it possible to pass "file://" URIs to the program + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +src/input/linput.c +src/input/linput.h + +commit d796a73 +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-10 + + quvi-dump: Do not escape reserved chars in URLs + + Other: + * Escape UTF8 chars in the URLs (lprint:{rfc2483,json}) + + See also: + * https://tools.ietf.org/html/rfc3986#section-2.2 + * https://en.wikipedia.org/wiki/Percent-encoding + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +src/main.c +src/print/json_print.c +src/print/rfc2483_print.c +src/print/xml_print.c + +commit 384a628 +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-10 + + FIX: array initialized from parenthesized string constant (compilation) + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +src/util/xchg.c + +commit 0c23359 +Author: Toni Gundogdu <lega...@gmail.com> +Date: 2013-10-10 + + FIX: comma at end of enumerator list (compilation) + + Signed-off-by: Toni Gundogdu <lega...@gmail.com> + +src/pbar/lpbar.c + commit c862c5b Author: Toni Gundogdu <lega...@gmail.com> Date: 2013-10-05 diff -Nru quvi-0.9.4/configure quvi-0.9.5/configure --- quvi-0.9.4/configure 2013-10-05 05:33:42.000000000 -0400 +++ quvi-0.9.5/configure 2013-11-10 03:00:59.000000000 -0500 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for quvi 0.9.4. +# Generated by GNU Autoconf 2.69 for quvi 0.9.5. # # Report bugs to <http://quvi.sf.net/bugs/>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='quvi' PACKAGE_TARNAME='quvi' -PACKAGE_VERSION='0.9.4' -PACKAGE_STRING='quvi 0.9.4' +PACKAGE_VERSION='0.9.5' +PACKAGE_STRING='quvi 0.9.5' PACKAGE_BUGREPORT='http://quvi.sf.net/bugs/' PACKAGE_URL='http://quvi.sf.net/' @@ -1378,7 +1378,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures quvi 0.9.4 to adapt to many kinds of systems. +\`configure' configures quvi 0.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1449,7 +1449,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of quvi 0.9.4:";; + short | recursive ) echo "Configuration of quvi 0.9.5:";; esac cat <<\_ACEOF @@ -1587,7 +1587,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -quvi configure 0.9.4 +quvi configure 0.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2002,7 +2002,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by quvi $as_me 0.9.4, which was +It was created by quvi $as_me 0.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4266,7 +4266,7 @@ # Define the identity of the package. PACKAGE='quvi' - VERSION='0.9.4' + VERSION='0.9.5' cat >>confdefs.h <<_ACEOF @@ -15997,7 +15997,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by quvi $as_me 0.9.4, which was +This file was extended by quvi $as_me 0.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16064,7 +16064,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -quvi config.status 0.9.4 +quvi config.status 0.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru quvi-0.9.4/debian/changelog quvi-0.9.5/debian/changelog --- quvi-0.9.4/debian/changelog 2021-09-03 23:17:49.000000000 -0400 +++ quvi-0.9.5/debian/changelog 2022-08-25 10:53:26.000000000 -0400 @@ -1,3 +1,15 @@ +quvi (0.9.5-0.1) unstable; urgency=high + + * Non-maintainer upload. + * New upstream release. + * debian/patches/0002-Avoid-duplicated-symbol-write.patch: + Add patch to avoid duplicated symbol "write"; rename to "lpbar_write". + (Closes: #1017147) + * debian/source/options: Dropped due to lintian warning + custom-compression-in-debian-source-options. + + -- Boyuan Yang <by...@debian.org> Thu, 25 Aug 2022 10:53:26 -0400 + quvi (0.9.4-1.2) unstable; urgency=high * Non-maintainer upload. diff -Nru quvi-0.9.4/debian/patches/0002-Avoid-duplicated-symbol-write.patch quvi-0.9.5/debian/patches/0002-Avoid-duplicated-symbol-write.patch --- quvi-0.9.4/debian/patches/0002-Avoid-duplicated-symbol- write.patch 1969-12-31 19:00:00.000000000 -0500 +++ quvi-0.9.5/debian/patches/0002-Avoid-duplicated-symbol- write.patch 2022-08-25 10:45:22.000000000 -0400 @@ -0,0 +1,47 @@ +From: Boyuan Yang <by...@debian.org> +Date: Thu, 25 Aug 2022 10:44:43 -0400 +Subject: Avoid duplicated symbol write + +Rename symbol "write" to "lpbar_write" in enum structure. + +Bug-Debian: https://bugs.debian.org/1017147 +--- + src/pbar/lpbar.c | 4 ++-- + src/pbar/lpbar.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/pbar/lpbar.c b/src/pbar/lpbar.c +index c952c29..fdb3f6f 100644 +--- a/src/pbar/lpbar.c ++++ b/src/pbar/lpbar.c +@@ -64,7 +64,7 @@ lpbar_t lpbar_new() + { + lpbar_t p = g_new0(struct lpbar_s, 1); + p->counters.timer = g_timer_new(); +- p->mode = write; ++ p->mode = lpbar_write; + return (p); + } + +@@ -212,7 +212,7 @@ void lpbar_print(const lpbar_t p) + g_print(C_("Transfer mode with a reason", "skip <forced>")); + break; + case resume: +- case write: ++ case lpbar_write: + default: + g_print("%s", (p->initial_bytes ==0) + ? C_("Transfer mode (begin at offset 0)", "write") +diff --git a/src/pbar/lpbar.h b/src/pbar/lpbar.h +index 77d855a..a0e38e3 100644 +--- a/src/pbar/lpbar.h ++++ b/src/pbar/lpbar.h +@@ -21,7 +21,7 @@ + #ifndef lpbar_h + #define lpbar_h + +-typedef enum { retrieved_already, forced_skip, resume, write } lpbar_mode; ++typedef enum { retrieved_already, forced_skip, resume, lpbar_write } lpbar_mode; + + struct lpbar_s + { diff -Nru quvi-0.9.4/debian/patches/series quvi-0.9.5/debian/patches/series --- quvi-0.9.4/debian/patches/series 2021-09-03 23:16:58.000000000 -0400 +++ quvi-0.9.5/debian/patches/series 2022-08-25 10:45:22.000000000 -0400 @@ -1 +1,2 @@ 0001-Fix-FTBFS-with-autoconf-2.70.patch +0002-Avoid-duplicated-symbol-write.patch diff -Nru quvi-0.9.4/debian/source/options quvi-0.9.5/debian/source/options --- quvi-0.9.4/debian/source/options 2021-09-03 23:13:26.000000000 -0400 +++ quvi-0.9.5/debian/source/options 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ -compression = xz diff -Nru quvi-0.9.4/doc/man1/input.txt quvi-0.9.5/doc/man1/input.txt --- quvi-0.9.4/doc/man1/input.txt 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/doc/man1/input.txt 2013-11-10 02:58:30.000000000 -0500 @@ -4,5 +4,5 @@ The command will read stdin by default. The input is expected to _contain_ URLs. The command arguments are expected to be either URLs or file paths. If the input is read from either stdin or a file, the -contents are read as RFC2483. +contents are read as RFC2483. The input may contain file URIs. diff -Nru quvi-0.9.4/doc/man1/quvi.1 quvi-0.9.5/doc/man1/quvi.1 --- quvi-0.9.4/doc/man1/quvi.1 2013-10-05 05:34:19.000000000 -0400 +++ quvi-0.9.5/doc/man1/quvi.1 2013-11-10 03:01:17.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvi .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVI" "1" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVI" "1" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -Nru quvi-0.9.4/doc/man1/quvi-dump.1 quvi-0.9.5/doc/man1/quvi-dump.1 --- quvi-0.9.4/doc/man1/quvi-dump.1 2013-10-05 05:34:19.000000000 -0400 +++ quvi-0.9.5/doc/man1/quvi-dump.1 2013-11-10 03:01:17.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvi-dump .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVI\-DUMP" "1" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVI\-DUMP" "1" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -65,7 +65,7 @@ See \fBquvirc\fR(5) for more information about the groups and the variables that quvi parses\&. .SH "INPUT" .sp -The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. +The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. The input may contain file URIs\&. .SH "OPTIONS" .SS "Core" .PP diff -Nru quvi-0.9.4/doc/man1/quvi-get.1 quvi-0.9.5/doc/man1/quvi-get.1 --- quvi-0.9.4/doc/man1/quvi-get.1 2013-10-05 05:34:21.000000000 -0400 +++ quvi-0.9.5/doc/man1/quvi-get.1 2013-11-10 03:01:19.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvi-get .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVI\-GET" "1" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVI\-GET" "1" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ See \fBquvirc\fR(5) for more information about the groups and the variables that quvi parses\&. .SH "INPUT" .sp -The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. +The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. The input may contain file URIs\&. .SH "OPTIONS" .SS "Core" .PP diff -Nru quvi-0.9.4/doc/man1/quvi-info.1 quvi-0.9.5/doc/man1/quvi-info.1 --- quvi-0.9.4/doc/man1/quvi-info.1 2013-10-05 05:34:21.000000000 -0400 +++ quvi-0.9.5/doc/man1/quvi-info.1 2013-11-10 03:01:19.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvi-info .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVI\-INFO" "1" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVI\-INFO" "1" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -Nru quvi-0.9.4/doc/man1/quvi-scan.1 quvi-0.9.5/doc/man1/quvi-scan.1 --- quvi-0.9.4/doc/man1/quvi-scan.1 2013-10-05 05:34:22.000000000 -0400 +++ quvi-0.9.5/doc/man1/quvi-scan.1 2013-11-10 03:01:20.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvi-scan .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVI\-SCAN" "1" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVI\-SCAN" "1" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -50,7 +50,7 @@ See \fBquvirc\fR(5) for more information about the groups and the variables that quvi parses\&. .SH "INPUT" .sp -The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. +The command will read stdin by default\&. The input is expected to \fIcontain\fR URLs\&. The command arguments are expected to be either URLs or file paths\&. If the input is read from either stdin or a file, the contents are read as RFC2483\&. The input may contain file URIs\&. .SH "OPTIONS" .SS "Core" .PP diff -Nru quvi-0.9.4/doc/man5/quvirc.5 quvi-0.9.5/doc/man5/quvirc.5 --- quvi-0.9.4/doc/man5/quvirc.5 2013-10-05 05:34:23.000000000 -0400 +++ quvi-0.9.5/doc/man5/quvirc.5 2013-11-10 03:01:21.000000000 -0500 @@ -2,12 +2,12 @@ .\" Title: quvirc .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> -.\" Date: 10/05/2013 +.\" Date: 11/10/2013 .\" Manual: quvi Manual -.\" Source: quvi 0.9.4 +.\" Source: quvi 0.9.5 .\" Language: English .\" -.TH "QUVIRC" "5" "10/05/2013" "quvi 0\&.9\&.4" "quvi Manual" +.TH "QUVIRC" "5" "11/10/2013" "quvi 0\&.9\&.5" "quvi Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -Nru quvi-0.9.4/NEWS quvi-0.9.5/NEWS --- quvi-0.9.4/NEWS 2013-10-05 05:32:45.000000000 -0400 +++ quvi-0.9.5/NEWS 2013-11-10 02:59:40.000000000 -0500 @@ -1,3 +1,15 @@ +v0.9.5 [2013-11-10] + +Toni Gundogdu: + - FIX: compilation errors + - array initialized from parenthesized string constant [384a628] + - comma at end of enumerator list [0c23359] + - linput: Rewrite input parsing completely [d92133c] + - quvi-dump: Do not escape reserved chars in URLs [d796a73] + + 10 files changed, 135 insertions(+), 96 deletions(-) + + v0.9.4 [2013-10-05] Toni Gundogdu: diff -Nru quvi-0.9.4/po/quvi.pot quvi-0.9.5/po/quvi.pot --- quvi-0.9.4/po/quvi.pot 2013-10-05 05:34:15.000000000 -0400 +++ quvi-0.9.5/po/quvi.pot 2013-11-10 03:01:15.000000000 -0500 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: quvi 0.9.4\n" +"Project-Id-Version: quvi 0.9.5\n" "Report-Msgid-Bugs-To: http://quvi.sf.net/bugs/\n" -"POT-Creation-Date: 2013-10-05 12:34+0300\n" +"POT-Creation-Date: 2013-11-10 10:01+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <l...@li.org>\n" @@ -148,54 +148,64 @@ msgid "protocol `%s' is not supported" msgstr "" -#: src/input/linput.c:105 +#: src/input/linput.c:74 #, c-format -msgid "error: %s: while reading file: %s\n" +msgid "error: while reading file: %s\n" msgstr "" -#: src/input/linput.c:127 +#: src/input/linput.c:106 #, c-format -msgid "error: ignoring input value `%s': not an URL or a file\n" +msgid "error: while converting to URI: %s\n" msgstr "" -#: src/main.c:57 +#: src/input/linput.c:147 +#, c-format +msgid "error: %s: an invalid URI\n" +msgstr "" + +#: src/input/linput.c:174 +#, c-format +msgid "error: %s: neither a valid URI or a local file\n" +msgstr "" + +#: src/main.c:59 #, c-format msgid "error: while executing: `%s': %s\n" msgstr "" -#: src/main.c:80 +#: src/main.c:82 msgid "Query and print the property values" msgstr "" -#: src/main.c:81 +#: src/main.c:83 msgid "Save media stream to a file" msgstr "" -#: src/main.c:82 +#: src/main.c:84 msgid "Inspect the configuration and the script properties" msgstr "" -#: src/main.c:83 +#: src/main.c:85 msgid "Scan and print the found embedded media URLs" msgstr "" -#: src/main.c:119 +#: src/main.c:121 msgid "" "Usage: quvi [--version] [--help] COMMAND [ARGS]\n" "\n" msgstr "" -#: src/main.c:120 +#: src/main.c:122 msgid "quvi commands are:\n" msgstr "" -#: src/main.c:132 +#: src/main.c:134 msgid "" "\n" "See 'quvi help COMMAND' for more information on a specific command.\n" msgstr "" -#: src/main.c:178 +#: src/main.c:180 #, c-format msgid "error: `%s' is not a quvi command. See 'quvi help'.\n" msgstr "" @@ -311,25 +321,25 @@ msgid "error: %s\n" msgstr "" -#: src/print/rfc2483_print.c:159 +#: src/print/rfc2483_print.c:161 msgid "" "# Media streams\n" "#\n" msgstr "" -#: src/print/rfc2483_print.c:230 +#: src/print/rfc2483_print.c:232 msgid "" "# Playlist media URLs\n" "#\n" msgstr "" -#: src/print/rfc2483_print.c:275 +#: src/print/rfc2483_print.c:277 msgid "" "# Embedded media URLs\n" "#\n" msgstr "" -#: src/print/rfc2483_print.c:343 +#: src/print/rfc2483_print.c:345 msgid "" "# Subtitles\n" "#\n" @@ -368,7 +378,7 @@ msgid "while ending the XML element `%s'" msgstr "" -#: src/print/xml_print.c:192 +#: src/print/xml_print.c:197 msgid "while dumping the XML document" msgstr "" @@ -448,7 +458,7 @@ msgid "%s: while opening file: %s: %s" msgstr "" -#: src/util/input.c:36 +#: src/util/input.c:38 msgid "error: no input URL\n" msgstr "" diff -Nru quvi-0.9.4/src/input/linput.c quvi-0.9.5/src/input/linput.c --- quvi-0.9.4/src/input/linput.c 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/src/input/linput.c 2013-11-10 02:58:30.000000000 -0500 @@ -21,75 +21,44 @@ #include "config.h" #include <unistd.h> +#include <stdlib.h> #include <string.h> #include <glib/gi18n.h> -#include "lutil.h" #include "linput.h" +#include "lutil.h" -static gchar *_read_stdin(linput_t linput) +static gchar *_read_stdin() { - gchar *s, *r, *p; GIOChannel *c; - gsize n, sn; + gchar *r, *s; + gsize n; c = g_io_channel_unix_new(STDIN_FILENO); - s = NULL; - r = NULL; + r = s = NULL; n = 0; while (g_io_channel_read_line(c, &s, NULL, NULL, NULL) != G_IO_STATUS_EOF) { - sn = strlen(s); - p = g_realloc(r, n+sn+1); + gchar *p; + gsize l; + + l = strlen(s); + p = g_realloc(r, n+l+1); + if (p != NULL) { r = p; - memcpy(&(r[n]), s, sn); - n += sn; + memcpy(&r[n], s, l); + n += l; r[n] = '\0'; } g_free(s); - s = NULL; } + g_io_channel_unref(c); return (r); } -static gboolean _has_uri_scheme(const gchar *s, gchar **dst) -{ - gchar *p, *t; - gboolean r; - - t = g_uri_unescape_string(s, NULL); - p = g_uri_parse_scheme(t); - r = (p != NULL) ? TRUE:FALSE; - g_free(p); - - if (dst != NULL && r == TRUE) - *dst = t; - else - g_free(t); - - return (r); -} - -static void _extract_urls(const gchar *b, linput_t l) -{ - gchar **r, *u; - gint i; - - r = g_uri_list_extract_uris(b); - i = 0; - - while (r[i] != NULL) - { - if (_has_uri_scheme(r[i], &u) == TRUE) - l->url.input = lutil_slist_prepend_if_unique(l->url.input, u); - ++i; - } - g_strfreev(r); -} - static gchar *_read_file(const gchar *fpath) { GError *e; @@ -102,72 +71,129 @@ { if (e != NULL) { - g_printerr(_("error: %s: while reading file: %s\n"), - fpath, e->message); + g_printerr(_("error: while reading file: %s\n"), e->message); g_error_free(e); - e = NULL; } } return (r); } -static void _no_rargs(linput_t linput) +static gint _extract_uris(linput_t, const gchar*); + +static gint _read_from_uri(linput_t p, const gchar *u) { - gchar *b = _read_stdin(linput); - if (b != NULL) + GError *e; + gchar *f; + gint r; + + r = EXIT_FAILURE; + e = NULL; + f = g_filename_from_uri(u, NULL, &e); + + if (f !=NULL) + { + gchar *c = _read_file(f); + if (c !=NULL) + { + r = _extract_uris(p, c); + r = EXIT_SUCCESS; + g_free(c); + } + g_free(f); + } + else { - _extract_urls(b, linput); - g_free(b); + g_printerr(_("error: while converting to URI: %s\n"), e->message); + g_error_free(e); } + return (r); } -static void _have_rargs(linput_t linput, const gchar **rargs) +static gint _determine_input(linput_t p, const gboolean try_read_as_file, + const gchar *invalid_msg, const gchar *s) { - static const gchar *_E = - N_("error: ignoring input value `%s': not an URL or a file\n"); + gchar *c; + gint r; - gchar *p, *u; - gint i; + c = g_uri_parse_scheme(s); + r = EXIT_SUCCESS; - i = 0; - while (rargs[i] != NULL) + if ((c ==NULL || strlen(c) ==0) && try_read_as_file ==TRUE) { - p = (gchar*) rargs[i++]; - g_strstrip(p); - - /* If file. */ - if (g_file_test(p, G_FILE_TEST_IS_REGULAR) == TRUE) - { - gchar *b = _read_file(p); - if (b != NULL) - { - _extract_urls(b, linput); - g_free(b); - } - } - /* If URI. */ - else if (_has_uri_scheme(p, &u) == TRUE) + gchar *b = _read_file(s); + if (b != NULL) { - linput->url.input = - lutil_slist_prepend_if_unique(linput->url.input, u); + r = _extract_uris(p, b); + g_free(b); } - /* Unable to determine. */ else - g_printerr(g_dgettext(GETTEXT_PACKAGE, _E), p); + r = EXIT_FAILURE; + } + else if (g_strcmp0(c, "http") ==0 || g_strcmp0(c, "https") ==0) + p->url.input = lutil_slist_prepend_if_unique(p->url.input, s); + else if (g_strcmp0(c, "file") ==0) + r = _read_from_uri(p, s); + else + { + g_printerr(g_dgettext(GETTEXT_PACKAGE, invalid_msg), s); + r = EXIT_FAILURE; } + g_free(c); + return (r); } -void linput_new(linput_t linput, const gchar **rargs) +static gint _extract_uris(linput_t p, const gchar *s) { + static const gchar *E = N_("error: %s: an invalid URI\n"); + + gchar **u; + gint i, r; + + u = g_uri_list_extract_uris(s); + + for (i=0, r=EXIT_SUCCESS; u[i] !=NULL && r==EXIT_SUCCESS; ++i) + r = _determine_input(p, FALSE, E, u[i]); + + g_strfreev(u); + return (r); +} + +static gint _parse_without_rargs(linput_t p) +{ + gchar *c; + gint r; + c = _read_stdin(); + r = _extract_uris(p, c); + g_free(c); + return (r); +} + +static gint _parse_with_rargs(linput_t p, const gchar **rargs) +{ + static const gchar *E = + N_("error: %s: neither a valid URI or a local file\n"); + + gint i, r; + for (i=0, r=EXIT_SUCCESS; rargs[i] !=NULL && r ==EXIT_SUCCESS; ++i) + r = _determine_input(p, TRUE, E, rargs[i]); + + return (r); +} + +gint linput_new(linput_t linput, const gchar **rargs) +{ + gint r; + g_assert(linput != NULL); g_assert(linput->url.input == NULL); if (rargs == NULL || g_strv_length((gchar**) rargs) == 0) - _no_rargs(linput); + r = _parse_without_rargs(linput); else - _have_rargs(linput, rargs); + r = _parse_with_rargs(linput, rargs); linput->url.input = g_slist_reverse(linput->url.input); + return (r); } void linput_free(linput_t linput) diff -Nru quvi-0.9.4/src/input/linput.h quvi-0.9.5/src/input/linput.h --- quvi-0.9.4/src/input/linput.h 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/src/input/linput.h 2013-11-10 02:58:30.000000000 -0500 @@ -1,5 +1,5 @@ /* quvi - * Copyright (C) 2012 Toni Gundogdu <lega...@gmail.com> + * Copyright (C) 2012,2013 Toni Gundogdu <lega...@gmail.com> * * This file is part of quvi <http://quvi.sourceforge.net/>. * @@ -31,7 +31,7 @@ typedef struct linput_s *linput_t; -void linput_new(linput_t, const gchar**); +gint linput_new(linput_t, const gchar**); void linput_free(linput_t); #endif /* linput_h */ diff -Nru quvi-0.9.4/src/main.c quvi-0.9.5/src/main.c --- quvi-0.9.4/src/main.c 2013-10-05 05:32:45.000000000 -0400 +++ quvi-0.9.5/src/main.c 2013-11-10 02:58:30.000000000 -0500 @@ -29,6 +29,8 @@ #include "opts.h" #include "cmd.h" +const gchar *reserved_chars = "!*'();:@&=+$,/?#[]"; + struct opts_s opts; gint exit_status; gchar *argv0; diff -Nru quvi-0.9.4/src/pbar/lpbar.c quvi-0.9.5/src/pbar/lpbar.c --- quvi-0.9.4/src/pbar/lpbar.c 2013-07-14 18:27:04.000000000 -0400 +++ quvi-0.9.5/src/pbar/lpbar.c 2013-11-10 02:58:30.000000000 -0500 @@ -29,7 +29,7 @@ { Ki = 1024, Mi = 1048576, - Gi = 1073741824, + Gi = 1073741824 } ieee_1541; #define _s(n) #n diff -Nru quvi-0.9.4/src/print/json_print.c quvi- 0.9.5/src/print/json_print.c --- quvi-0.9.4/src/print/json_print.c 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/src/print/json_print.c 2013-11-10 02:58:30.000000000 -0500 @@ -103,6 +103,8 @@ return (EXIT_SUCCESS); } +extern const gchar *reserved_chars; + void lprint_json_errmsg(const gchar *fmt, ...) { va_list args; @@ -111,7 +113,7 @@ va_start(args, fmt); if (g_vasprintf(&s, fmt, args) >0) { - gchar *e = g_uri_escape_string(s, NULL, TRUE); + gchar *e = g_uri_escape_string(s, reserved_chars, FALSE); g_printerr("{\"error\" : \"%s\"}\n", e); g_free(e); g_free(s); @@ -158,7 +160,7 @@ json_builder_set_member_name(p->b, n); if (s != NULL) { - gchar *e = g_uri_escape_string(s, NULL, TRUE); + gchar *e = g_uri_escape_string(s, reserved_chars, FALSE); json_builder_add_string_value(p->b, e); g_free(e); } @@ -455,7 +457,7 @@ json_builder_begin_object(p->b); json_builder_set_member_name(p->b, "url"); - e = g_uri_escape_string(s, NULL, TRUE); + e = g_uri_escape_string(s, reserved_chars, FALSE); json_builder_add_string_value(p->b, e); json_builder_end_object(p->b); diff -Nru quvi-0.9.4/src/print/rfc2483_print.c quvi- 0.9.5/src/print/rfc2483_print.c --- quvi-0.9.4/src/print/rfc2483_print.c 2013-10-03 08:56:39.000000000 -0400 +++ quvi-0.9.5/src/print/rfc2483_print.c 2013-11-10 02:58:30.000000000 -0500 @@ -70,6 +70,8 @@ return (r); } +extern const gchar *reserved_chars; + static gint _print(const rfc2483_t p, const lutilPropertyType pt, const gchar *n, const gchar *s, const gdouble d, const gboolean comment_out, const gboolean escape) @@ -87,7 +89,7 @@ { if (escape == TRUE) { - gchar *e = g_uri_escape_string(s, NULL, TRUE); + gchar *e = g_uri_escape_string(s, reserved_chars, FALSE); g_print("%s%s\n", h, e); g_free(e); } @@ -275,7 +277,7 @@ g_print(_("# Embedded media URLs\n#\n")); while ( (s = quvi_scan_next_media_url(qs)) != NULL) { - gchar *e = g_uri_escape_string(s, NULL, TRUE); + gchar *e = g_uri_escape_string(s, reserved_chars, FALSE); g_print("%s\n", e); g_free(e); } diff -Nru quvi-0.9.4/src/print/xml_print.c quvi-0.9.5/src/print/xml_print.c --- quvi-0.9.4/src/print/xml_print.c 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/src/print/xml_print.c 2013-11-10 02:58:30.000000000 -0500 @@ -141,15 +141,20 @@ return (r); } +extern const gchar *reserved_chars; + static gint _write_attr(const xml_t p, const gchar *n, const gchar *s) { xmlChar *e; gint r; - e = xmlURIEscapeStr(BAD_CAST s, NULL); + e = xmlURIEscapeStr(BAD_CAST s, BAD_CAST reserved_chars); + + r = (xmlTextWriterWriteAttribute(p->w, BAD_CAST n, e) <0) ? EXIT_FAILURE : EXIT_SUCCESS; + xmlFree(e); if (r != EXIT_SUCCESS) @@ -206,7 +211,7 @@ va_start(args, fmt); if (g_vasprintf(&s, fmt, args) >0) { - xmlChar *e = xmlURIEscapeStr(BAD_CAST s, NULL); + xmlChar *e = xmlURIEscapeStr(BAD_CAST s, BAD_CAST reserved_chars); g_printerr("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<error message=\"%s\" />", e); xmlFree(e); diff -Nru quvi-0.9.4/src/util/input.c quvi-0.9.5/src/util/input.c --- quvi-0.9.4/src/util/input.c 2013-05-19 11:45:18.000000000 -0400 +++ quvi-0.9.5/src/util/input.c 2013-11-10 02:58:30.000000000 -0500 @@ -30,7 +30,9 @@ { linput_t l = (linput_t) p; - linput_new(l, rargs); + if (linput_new(l, rargs) != EXIT_SUCCESS) + return (EXIT_FAILURE); + if (g_slist_length(l->url.input) ==0) { g_printerr(_("error: no input URL\n")); diff -Nru quvi-0.9.4/src/util/xchg.c quvi-0.9.5/src/util/xchg.c --- quvi-0.9.4/src/util/xchg.c 2013-07-14 07:56:34.000000000 -0400 +++ quvi-0.9.5/src/util/xchg.c 2013-11-10 02:58:30.000000000 -0500 @@ -47,7 +47,7 @@ {0, 0, NULL} }; -static const gchar default_str[] = N_("default"); +static const gchar *default_str = N_("default"); /* Return a media property value. */ static gchar *_qm_get(quvi_media_t qm, const gint i) diff -Nru quvi-0.9.4/VERSION quvi-0.9.5/VERSION --- quvi-0.9.4/VERSION 2013-10-05 05:34:15.000000000 -0400 +++ quvi-0.9.5/VERSION 2013-11-10 03:01:15.000000000 -0500 @@ -1 +1 @@ -v0.9.4 +v0.9.5
signature.asc
Description: This is a digitally signed message part