[pkg-fso-commits] [nodm] 45/50: upstream: Rename symbol "basename" to "nodm_basename". This is to avoid naming conflicts with the basename() function from <string.h>.

Mike Gabriel sunweaver at debian.org
Mon Jan 23 15:19:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository nodm.

commit 046f3c4dfde43b6bb3ff68cc39e96eb63f54504d
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu Mar 24 17:12:32 2016 +0100

    upstream: Rename symbol "basename" to "nodm_basename". This is to avoid naming conflicts with the basename() function from <string.h>.
---
 common.c         | 2 +-
 common.h         | 2 +-
 debian/changelog | 3 +++
 nodm.c           | 4 ++--
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/common.c b/common.c
index 5a939ac..d8e19bb 100644
--- a/common.c
+++ b/common.c
@@ -26,7 +26,7 @@
 #include <errno.h>
 
 
-const char* basename (const char* str)
+const char* nodm_basename (const char* str)
 {
     const char *cp = strrchr (str, '/');
     return cp ? cp + 1 : str;
diff --git a/common.h b/common.h
index c8c4bdf..45be469 100644
--- a/common.h
+++ b/common.h
@@ -48,7 +48,7 @@
 #define E_USER_QUIT           221   ///< Quit requested
 
 /// Return the basename of a path, as a pointer inside \a str
-const char* basename (const char* str);
+const char* nodm_basename (const char* str);
 
 /**
  * Like getenv, but if the variable is not defined it returns \a def
diff --git a/debian/changelog b/debian/changelog
index 73634cf..af7592a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 nodm (0.12-2) UNRELEASED; urgency=medium
 
+  * Upstream code:
+    - Rename symbol "basename" to "nodm_basename". This is to avoid
+      naming conflicts with the basename() function from <string.h>.
   * debian/changelog:
     + Add post-upload closure for #638601. Bug has been closed manually
       meanwhile (on Thu 24th Mar 2016).
diff --git a/nodm.c b/nodm.c
index 0ee465e..f510127 100644
--- a/nodm.c
+++ b/nodm.c
@@ -117,13 +117,13 @@ int main (int argc, char **argv)
     // We only run if we are root
     if (!opt_nested && getuid() != 0)
     {
-        fprintf(stderr, "%s: can only be run by root\n", basename(argv[0]));
+        fprintf(stderr, "%s: can only be run by root\n", nodm_basename(argv[0]));
         return E_NOPERM;
     }
 
     // Setup logging
     struct log_config cfg = {
-        .program_name = basename(argv[0]),
+        .program_name = nodm_basename(argv[0]),
     };
     if (opt_quiet)
         cfg.log_level = NODM_LL_WARN;

-- 
Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-fso/nodm.git



More information about the pkg-fso-commits mailing list