chiark / gitweb /
util: mark unquote() static, so that new code doesn't use this anymore
authorLennart Poettering <lennart@poettering.net>
Fri, 10 Apr 2015 10:16:54 +0000 (12:16 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 06:55:02 +0000 (07:55 +0100)
src/shared/util.c
src/shared/util.h

index 3561573e16da8fe190be18da21defd53e53a01f6..a82ac25f6fb9c1ac15a92b28858425d01cfb506d 100644 (file)
@@ -3676,14 +3676,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)
@@ -3872,7 +3873,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;
 
index 1026070f209078fca27cf4dfa78e032b2d2a677e..9368e84d57d2eb1b66adb7c62ea2f24c9a03db5c 100644 (file)
@@ -523,7 +523,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);