From b31973ab0712758efc041c1ce09bc1fa6bc9fc67 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 7 Jun 2010 10:48:14 +0200 Subject: trace-cmd: quote path definitions Rather than using MAKE_STR(), quote path definitions on the command line so that the preprocessor sees a string already. This avoids problems with path names that aren't valid expressions. Signed-off-by: Johannes Berg Signed-off-by: Steven Rostedt --- Makefile | 4 ++-- plugin_python.c | 4 ++-- trace-util.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a1096f2..1ad0859 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ python_dir = $(HOME)/.trace-cmd/python else plugin_dir = $(prefix)/share/trace-cmd/plugins python_dir = $(prefix)/share/trace-cmd/python -PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) -PYTHON_DIR = -DPYTHON_DIR=$(python_dir) +PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)" +PYTHON_DIR = -DPYTHON_DIR="$(python_dir)" PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))' endif diff --git a/plugin_python.c b/plugin_python.c index 74a4cfe..4212cde 100644 --- a/plugin_python.c +++ b/plugin_python.c @@ -3,12 +3,12 @@ #include "trace-cmd.h" #ifndef PYTHON_DIR -#define PYTHON_DIR . +#define PYTHON_DIR "." #endif static const char pypath[] = "import sys\n" -"sys.path.append(\"" MAKE_STR(PYTHON_DIR) "\")\n"; +"sys.path.append(\"" PYTHON_DIR "\")\n"; static const char pyload[] = "import imp, tracecmd, ctracecmd\n" diff --git a/trace-util.c b/trace-util.c index fba6a8d..6605f1f 100644 --- a/trace-util.c +++ b/trace-util.c @@ -354,7 +354,7 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix, /* If a system plugin directory was defined, check that first */ #ifdef PLUGIN_DIR if (!tracecmd_disable_sys_plugins) - trace_util_load_plugins_dir(pevent, suffix, MAKE_STR(PLUGIN_DIR), + trace_util_load_plugins_dir(pevent, suffix, PLUGIN_DIR, load_plugin, data); #endif -- cgit v1.2.2