Commit Graph

17 Commits

Author SHA1 Message Date
Sami Kerola d6cf9e1669 rename: continue despite something failed
Try to do all file operations even when one or some of them fail, and
use exit value to inform what happen.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-18 18:34:15 +01:00
Sami Kerola bd9ced628b rename: allow renaming in subdirectories
Earlier the rename(1) considered path as possible string to be renamed,
could lead to an issue with none existing destination.  See below for
demonstration of this issue.  After this change all directory elements
are ignored when the match finding happens.

$ cd $(mktemp -d)
$ mkdir aa ab
$ touch a{a,b}/aa
$ rename -v a x */aa
rename: aa/aa: rename to xa/aa failed: No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-18 18:34:14 +01:00
Karel Zak af5f87a678 rename: fix mem leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-14 17:56:47 +01:00
Karel Zak 23b4715b8d rename: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27 16:29:48 +01:00
Sami Kerola 540dfebe3e rename: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:05 +01:00
Benno Schulenberg 8c219bf463 textual: gettextize several overlooked messages
Also improve the clarity of some of them.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-25 11:47:29 +01:00
Karel Zak c717b0328d rename: use macro to print version
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-10 13:14:38 +01:00
Jan (yac) Matějka 5a2a8177f8 rename: add --symlink option for renaming symlink target
[kzak@redhat.com: - coding style clean up]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-10 13:07:09 +01:00
Sami Kerola c05a80ca63 misc-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:56:48 +02:00
Karel Zak f70e2a11c8 rename: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 12:36:00 +02:00
Sami Kerola d200a926df rename: verbose option & maintenance fixes
The rename has new verbose option which will print which files
where renamed. Maintenance fixes includes long options, coding
style and freeing memory after usage.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:45:27 +02:00
Davidlohr Bueso 87f3feac71 misc-utils: use new xmalloc() wrapper
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-10-21 10:31:50 +02:00
Li Zefan 14608fdff0 rename: remove useless variable
The number of files successfully renamed is calculated and stored in variable
ct, > but actually the variable is not used afterwards.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-09-05 11:51:11 +02:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak eb63b9b8f4 Imported from util-linux-2.10f tarball. 2006-12-07 00:25:41 +01:00