summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2019-04-24 18:31:08 +0200
committerKarel Zak2019-04-24 18:31:08 +0200
commit08a2cf7292511d27969c900f5ce6b01569e61733 (patch)
treeb22cc7f6cda50e58af569e9b522b1018cedd9e23 /misc-utils
parentpo: update sv.po (from translationproject.org) (diff)
downloadkernel-qcow2-util-linux-08a2cf7292511d27969c900f5ce6b01569e61733.tar.gz
kernel-qcow2-util-linux-08a2cf7292511d27969c900f5ce6b01569e61733.tar.xz
kernel-qcow2-util-linux-08a2cf7292511d27969c900f5ce6b01569e61733.zip
hardlink: remove \r from output
* remove \r from internationalized messages * remove \r from all output to make it easy to use (see for example output file from "hardlink -vv --dry-run . &> log") * remove unnecessary formatting stuff from output, just keep is simple and stupid... Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/hardlink.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c
index 2a1e216a2..953b3b7f9 100644
--- a/misc-utils/hardlink.c
+++ b/misc-utils/hardlink.c
@@ -212,7 +212,7 @@ static void process_path(const char *name)
nregfiles++;
if (verbose > 1)
- printf(" %s", name);
+ printf("%s\n", name);
fd = open(name, O_RDONLY);
if (fd < 0)
@@ -225,8 +225,6 @@ static void process_path(const char *name)
}
if (read(fd, buf, cksumsize) != cksumsize) {
close(fd);
- if (verbose > 1 && namelen <= PATH_MAX)
- printf("\r%*s\r", (int)(namelen + 2), "");
return;
}
cksumsize = (cksumsize + sizeof(buf[0]) - 1) / sizeof(buf[0]);
@@ -255,8 +253,6 @@ static void process_path(const char *name)
for (fp2 = fp; fp2 && fp2->cksum == cksum; fp2 = fp2->next) {
if (fp2->ino == st.st_ino && fp2->dev == st.st_dev) {
close(fd);
- if (verbose > 1 && namelen <= PATH_MAX)
- printf("\r%*s\r", (int)(namelen + 2), "");
return;
}
}
@@ -349,17 +345,13 @@ static void process_path(const char *name)
/* We actually did not save anything this time, since the link second argument
had some other links as well. */
if (verbose > 1)
- printf(_("\r%*s\r%s %s to %s\n"),
- (int)(((namelen > PATH_MAX) ? 0 : namelen) + 2),
- "",
+ printf(_(" %s %s to %s\n"),
(no_link ? _("Would link") : _("Linked")),
n1, n2);
} else {
nsaved += ((st.st_size + 4095) / 4096) * 4096;
if (verbose > 1)
- printf(_("\r%*s\r%s %s to %s, %s %jd\n"),
- (int)(((namelen > PATH_MAX) ? 0 : namelen) + 2),
- "",
+ printf(_(" %s %s to %s, %s %jd\n"),
(no_link ? _("Would link") : _("Linked")),
n1, n2,
(no_link ? _("would save") : _("saved")),
@@ -383,8 +375,6 @@ static void process_path(const char *name)
fp2->next = hp->chain;
hp->chain = fp2;
}
- if (verbose > 1 && namelen <= PATH_MAX)
- printf("\r%*s\r", (int)(namelen + 2), "");
return;
}
}