[systemd-commits] src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Fri Apr 10 03:18:00 PDT 2015


 src/shared/util.c |    9 +++++----
 src/shared/util.h |    1 -
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e1eaca26cb971410ac9668c4123bcecaecedb3ab
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Apr 10 12:16:54 2015 +0200

    util: mark unquote() static, so that new code doesn't use this anymore

diff --git a/src/shared/util.c b/src/shared/util.c
index 61f3090..6e5c5ca 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3655,14 +3655,15 @@ int touch(const char *path) {
         return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, 0);
 }
 
-char *unquote(const char *s, const char* quotes) {
+static char *unquote(const char *s, const char* quotes) {
         size_t l;
         assert(s);
 
         /* This is rather stupid, simply removes the heading and
          * trailing quotes if there is one. Doesn't care about
-         * escaping or anything. We should make this smarter one
-         * day... */
+         * escaping or anything.
+         *
+         * DON'T USE THIS FOR NEW CODE ANYMORE!*/
 
         l = strlen(s);
         if (l < 2)
@@ -3851,7 +3852,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
         _cleanup_free_ char *t = NULL, *u = NULL;
         size_t enc_len;
 
-        u = unquote(tagvalue, "\"\'");
+        u = unquote(tagvalue, QUOTES);
         if (!u)
                 return NULL;
 
diff --git a/src/shared/util.h b/src/shared/util.h
index 737a3f3..4a7f0da 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -522,7 +522,6 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne
 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
 int touch(const char *path);
 
-char *unquote(const char *s, const char *quotes);
 char *normalize_env_assignment(const char *s);
 
 int wait_for_terminate(pid_t pid, siginfo_t *status);



More information about the systemd-commits mailing list