]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: metadump: simplify '/' handling
authorAlex Elder <aelder@sgi.com>
Fri, 18 Feb 2011 21:21:01 +0000 (21:21 +0000)
committerAlex Elder <aelder@sgi.com>
Tue, 8 Mar 2011 18:04:03 +0000 (12:04 -0600)
commitad6bb8391051fab8f38d45c1e5063aba52db0295
treec7afee221e970a0db7b4f7f08c608f6e7b9a402a
parent56281ed43abe95e96e45d2287fd0b965b7d4d2b8
xfsprogs: metadump: simplify '/' handling

In generate_obfuscated_name(), the incoming name is allowed to start
with a '/' character, in which case it is copied over to the new
name and ignored for the remainder of the hash calculation.  A '/'
character is needlessly included at the beginning of each name
stashed in the duplicates table (regardless of whether one was
present in the name provided).

Simplify the affected code by processing the '/' right away, and
using a pointer thereafter for the start of the new name.  Stop
including a leading '/' in the name used for duplicate detection.

Note:  It is not clear a leading '/' character is ever even present
in a name presented for obfuscation.  I have not investigated this
question; this change merely adjusts the code while preserving its
original functionality.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
db/metadump.c