Bug#328931: Hard to understand error messages from faulty .rtorrent.rc file

2005-09-22 Thread Qingning Huo
tag 328931 + upstream
thanks

On Sun, Sep 18, 2005 at 11:39:19AM +0200, Ole-Morten Duesund wrote:
 Package: rtorrent
 Version: 0.3.3-1
 Severity: minor
 Tags: patch
 
 I inadvertently put something like:
 
 directory=/mytorrents
 
 instead of
 
 directory = /mytorrents
 
 into the ~/.rtorrents.rc file. One thing is that rtorrent _really_ needs
 the spaces surrounding the = sign, another thing is that the
 errormessage is really unhelpful:
 Caught exception: Error parseing option file.
 
 I've attached a patch that adds the faulty line to the error message,
 thus giving the poor user (me in this case) a bit more information about
 what went wrong. I also fixed the parseing/parsing typo.
 
 - Ole-Morten Duesund
 

Hi,

Many thanks for your bug report.  This is an upstream problem.  The
upstream author plans to solve it after the 0.8 milestone.

Regards,

Qingning



signature.asc
Description: Digital signature


Bug#328931: Hard to understand error messages from faulty .rtorrent.rc file

2005-09-18 Thread Ole-Morten Duesund
Package: rtorrent
Version: 0.3.3-1
Severity: minor
Tags: patch

I inadvertently put something like:

directory=/mytorrents

instead of

directory = /mytorrents

into the ~/.rtorrents.rc file. One thing is that rtorrent _really_ needs
the spaces surrounding the = sign, another thing is that the
errormessage is really unhelpful:
Caught exception: Error parseing option file.

I've attached a patch that adds the faulty line to the error message,
thus giving the poor user (me in this case) a bit more information about
what went wrong. I also fixed the parseing/parsing typo.

- Ole-Morten Duesund

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-k7
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages rtorrent depends on:
ii  libc6 2.3.5-6GNU C Library: Shared libraries an
ii  libcurl3  7.14.0-5   Multi-protocol file transfer libra
ii  libgcc1   1:4.0.1-7  GCC support library
ii  libidn11  0.5.18-1   GNU libidn library, implementation
ii  libncurses5   5.4-9  Shared libraries for terminal hand
ii  libsigc++-2.0-0c2 2.0.10-3   type-safe Signal Framework for C++
ii  libssl0.9.7   0.9.7g-2   SSL shared libraries
ii  libstdc++64.0.1-7The GNU Standard C++ Library v3
ii  libtorrent5   0.7.3-1a C++ BitTorrent library
ii  zlib1g1:1.2.3-4  compression library - runtime

rtorrent recommends no packages.

-- no debconf information
diff -ur -x '*.o' orig/rtorrent-0.3.3/src/option_file.cc rtorrent-0.3.3/src/option_file.cc
--- orig/rtorrent-0.3.3/src/option_file.cc	2005-09-02 21:16:13.0 +0200
+++ rtorrent-0.3.3/src/option_file.cc	2005-09-18 11:23:07.0 +0200
@@ -68,8 +68,10 @@
   // Check for empty lines, and options within abc.
   if ((result = std::sscanf(line, %63s = \%511[^\]s, key, opt)) != 2 
   (result = std::sscanf(line, %63s = %511s, key, opt)) != 2 
-  result == 1)
-throw std::runtime_error(Error parseing option file.);
+  result == 1) {
+	std::string errormsg = Error parsing option file.\n:\t + std::string(line);
+	throw std::runtime_error(errormsg);
+  }
 
   if (opt[0] == ''  opt[1] == '')
 opt[0] = '\0';