Your message dated Wed, 28 Oct 2009 13:42:35 -0400
with message-id <[email protected]>
and subject line Re: Processed: tagging 422275
has caused the Debian Bug report #422275,
regarding coreutils: dd does not accept hex numbers as input
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
422275: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422275
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: coreutils
Version: 5.97-5.3
Severity: wishlist


It sure would be nice to to not have to convert hex numbers manually
when using dd...

        # dd bs=0x200
        dd: invalid number `0x200'

This was a really easy fix.  Here is the patch...

--- a/src/dd.c
+++ b/src/dd.c
@@ -829,7 +829,15 @@ parse_integer (const char *str, bool *invalid)
 {
   uintmax_t n;
   char *suffix;
-  enum strtol_error e = xstrtoumax (str, &suffix, 10, &n, "bcEGkKMPTwYZ0");
+  enum strtol_error e;
+  int base = 10;
+  
+  if (str[0] == '0' && str[1] == 'x')
+    {
+      str += 2;
+      base = 16;
+    }
+  e = xstrtoumax (str, &suffix, base, &n, "bcEGkKMPTwYZ0");
 
   if (e == LONGINT_INVALID_SUFFIX_CHAR && *suffix == 'x')
     {
 

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.20.7-xenon64-smp.14 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages coreutils depends on:
ii  libacl1                     2.2.42-1     Access control list shared library
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libselinux1                 1.32-3       SELinux shared libraries

coreutils recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
On Mon, Oct 26, 2009 at 09:34:08AM +0100, Jim Meyering wrote:
Thanks for the tag, but as far as I'm concerned,
this can be closed, since you can already use hex numbers,
as long as you're using a reasonable shell:

agreed

Mike Stone


--- End Message ---

Reply via email to