summaryrefslogtreecommitdiff
path: root/src/test/test-copy.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
commit63c372cb9df3bee01e3bf8cd7f96f336bddda846 (patch)
treebf4d1b6e41f72927a2b58e7dd21daa0c496aaa96 /src/test/test-copy.c
parent44de0efc6e406515fc1cf8b95d9655d0d7f7ffff (diff)
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
Diffstat (limited to 'src/test/test-copy.c')
-rw-r--r--src/test/test-copy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index 3e1607e51d..5c96f61005 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -90,15 +90,15 @@ static void test_copy_tree(void) {
rm_rf_dangerous(original_dir, false, true, false);
STRV_FOREACH(p, files) {
- char *f = strappenda(original_dir, *p);
+ char *f = strjoina(original_dir, *p);
assert_se(mkdir_parents(f, 0755) >= 0);
assert_se(write_string_file(f, "file") == 0);
}
STRV_FOREACH_PAIR(link, p, links) {
- char *f = strappenda(original_dir, *p);
- char *l = strappenda(original_dir, *link);
+ char *f = strjoina(original_dir, *p);
+ char *l = strjoina(original_dir, *link);
assert_se(mkdir_parents(l, 0755) >= 0);
assert_se(symlink(f, l) == 0);
@@ -109,7 +109,7 @@ static void test_copy_tree(void) {
STRV_FOREACH(p, files) {
_cleanup_free_ char *buf = NULL;
size_t sz = 0;
- char *f = strappenda(copy_dir, *p);
+ char *f = strjoina(copy_dir, *p);
assert_se(access(f, F_OK) == 0);
assert_se(read_full_file(f, &buf, &sz) == 0);
@@ -118,8 +118,8 @@ static void test_copy_tree(void) {
STRV_FOREACH_PAIR(link, p, links) {
_cleanup_free_ char *target = NULL;
- char *f = strappenda(original_dir, *p);
- char *l = strappenda(copy_dir, *link);
+ char *f = strjoina(original_dir, *p);
+ char *l = strjoina(copy_dir, *link);
assert_se(readlink_and_canonicalize(l, &target) == 0);
assert_se(path_equal(f, target));