From 583f6c9c2219f4270b16c36dfe7086e1b46161a5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 2 Jul 2007 12:40:40 +0000 Subject: [PATCH] 2007-07-02 Tatsuhiro Tsujikawa Fix the bug that causes -s option not to work. * src/main.cc (main) * src/a2algo.h: New file. --- ChangeLog | 6 ++++++ configure | 20 ++++++++++---------- configure.ac | 2 +- po/Makefile.in | 2 +- src/a2algo.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/main.cc | 11 +++++++++-- 6 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 src/a2algo.h diff --git a/ChangeLog b/ChangeLog index f8d60030..2f6b5ff8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-02 Tatsuhiro Tsujikawa + + Fix the bug that causes -s option not to work. + * src/main.cc (main) + * src/a2algo.h: New file. + 2007-07-01 Tatsuhiro Tsujikawa Create directory structure specified in metalink file. diff --git a/configure b/configure index 2b17a374..009b2e10 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for aria2c 0.11.0. +# Generated by GNU Autoconf 2.61 for aria2c 0.11.1. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='aria2c' PACKAGE_TARNAME='aria2c' -PACKAGE_VERSION='0.11.0' -PACKAGE_STRING='aria2c 0.11.0' +PACKAGE_VERSION='0.11.1' +PACKAGE_STRING='aria2c 0.11.1' PACKAGE_BUGREPORT='t-tujikawa@users.sourceforge.net' ac_unique_file="src/Socket.h" @@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then # 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 aria2c 0.11.0 to adapt to many kinds of systems. +\`configure' configures aria2c 0.11.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1345,7 +1345,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of aria2c 0.11.0:";; + short | recursive ) echo "Configuration of aria2c 0.11.1:";; esac cat <<\_ACEOF @@ -1466,7 +1466,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -aria2c configure 0.11.0 +aria2c configure 0.11.1 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1480,7 +1480,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by aria2c $as_me 0.11.0, which was +It was created by aria2c $as_me 0.11.1, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2150,7 +2150,7 @@ fi # Define the identity of the package. PACKAGE='aria2c' - VERSION='0.11.0' + VERSION='0.11.1' cat >>confdefs.h <<_ACEOF @@ -12941,7 +12941,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by aria2c $as_me 0.11.0, which was +This file was extended by aria2c $as_me 0.11.1, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12994,7 +12994,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -aria2c config.status 0.11.0 +aria2c config.status 0.11.1 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 037b6a11..859e010a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. # AC_PREREQ(2.59) -AC_INIT(aria2c, 0.11.0, t-tujikawa@users.sourceforge.net) +AC_INIT(aria2c, 0.11.1, t-tujikawa@users.sourceforge.net) AM_INIT_AUTOMAKE() AM_PATH_CPPUNIT(1.10.2) AC_CONFIG_SRCDIR([src/Socket.h]) diff --git a/po/Makefile.in b/po/Makefile.in index a76808c9..e2ebc11c 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -9,7 +9,7 @@ # General Public License and is *not* in the public domain. PACKAGE = aria2c -VERSION = 0.11.0 +VERSION = 0.11.1 SHELL = /bin/sh diff --git a/src/a2algo.h b/src/a2algo.h new file mode 100644 index 00000000..eeff683a --- /dev/null +++ b/src/a2algo.h @@ -0,0 +1,45 @@ +/* */ + +template +OutputIterator ncopy(InputIterator first, InputIterator last, + int32_t count, OutputIterator destination) +{ + OutputIterator x = destination; + for(int32_t i = 0; i < count; ++i) { + x = copy(first, last, destination); + } + return x; +} diff --git a/src/main.cc b/src/main.cc index 7fd9a940..fa707db6 100644 --- a/src/main.cc +++ b/src/main.cc @@ -51,6 +51,7 @@ #include "CUIDCounter.h" #include "UriFileListParser.h" #include "CookieBoxFactory.h" +#include "a2algo.h" #include #include #include @@ -747,7 +748,10 @@ int main(int argc, char* argv[]) { while(flparser.hasNext()) { Strings uris = flparser.next(); if(!uris.empty()) { - RequestGroupHandle rg = new RequestGroup(uris, op); + Strings xuris; + ncopy(uris.begin(), uris.end(), op->getAsInt(PREF_SPLIT), + back_inserter(xuris)); + RequestGroupHandle rg = new RequestGroup(xuris, op); groups.push_back(rg); } } @@ -755,7 +759,10 @@ int main(int argc, char* argv[]) { } else { - firstReqInfo = new MultiUrlRequestInfo(args, op); + Strings xargs; + ncopy(args.begin(), args.end(), op->getAsInt(PREF_SPLIT), + back_inserter(xargs)); + firstReqInfo = new MultiUrlRequestInfo(xargs, op); } RequestInfos reqInfos;