Re: [PATCH v4] Fixes CJK wide character display

2013-08-19 Thread Othman, Ossama
Hi,

CCing the list this time around ...

On Sun, Aug 18, 2013 at 7:59 PM, Peng Wu peng.e...@gmail.com wrote:

 By jumping two columns when wide character prints,
 and draw wide background under wide character.
 ---
  clients/terminal.c | 31 +--
  1 file changed, 29 insertions(+), 2 deletions(-)

 diff --git a/clients/terminal.c b/clients/terminal.c
 index 6701fb6..9da1a56 100644
 --- a/clients/terminal.c
 +++ b/clients/terminal.c
 @@ -33,6 +33,9 @@
  #include ctype.h
  #include cairo.h
  #include sys/epoll.h
 +#define __USE_XOPEN
 +#include wchar.h
 +#include locale.h


That's an implementation-specific preprocessor symbol.  Please use the
_XOPEN_SOURCE feature test macro instead.

The user could also potentially define that feature test macro with a
specific value, such as 500 (see
http://pubs.opengroup.org/onlinepubs/7908799/xsh/compilation.html), in
CPPFLAGS via the configure script as well, meaning it would be good to
check if _XOPEN_SOURCE is defined before explicitly defining it.

HTH,
-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston v2 4/4] weston.pc: Provide moduledir

2013-06-10 Thread Othman, Ossama
Hi,

--- a/src/Makefile.am
 +++ b/src/Makefile.am
 @@ -94,7 +94,6 @@ westoninclude_HEADERS =   \
 ../shared/matrix.h  \
 ../shared/config-parser.h

 -moduledir = $(libdir)/weston
  module_LTLIBRARIES =   \


On a related note, any idea why Weston doesn't use Automake's pkglib
prefix?  The corresponding pkglibdir variable ends up having the same
value.  Is it just a convention/clarity thing?  I realize Autoconf doesn't
support pkglibdir without help.

Thanks,
-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: Compiling weston now needs colord

2013-06-03 Thread Othman, Ossama
Hi,

On Thu, May 30, 2013 at 12:42 AM, sardemff7+wayl...@sardemff7.net wrote:

 On 30/05/2013 08:24, Michael Hasselmann wrote:

 On Tue, 2013-05-28 at 22:16 -0700, Bill Spitzak wrote:

 Running autogen.sh in weston with --disable-colord works to avoid this,
 I suspect nothing I care about is lost this way.


 I ran into the very same problems. I would have preferred if such new
 dependencies were optional or if someone would explain what we will miss
 if we disable them. For colord, trying to build the latest required
 version from git just pulls in more dependencies that you also have to
 build from git (as Bill mentioned).

 It's kind of frustrating, even if weston is meant to be a playground and
 thus new dependencies have to be expected.

 http://wayland.freedesktop.**org/building.htmlhttp://wayland.freedesktop.org/building.htmlshould
  be updated I guess?

 ciao Michael


 colord is an optional dependency: you just need to pass --disable-colord
 to ./configure (or ./autogen.sh), and it is gone.


Making the configure script have a hard failure by default if colord is
unavailable is not consistent with the dependency being optional.  Even if
--disable-colord is added to the configure/autogen.sh command line make
distcheck will still fail on platforms without colord installed since the
configure script flags are not passed down.  One could tweak the flags
passed to the distcheck target using AM_DISTCHECK_CONFIGURE_FLAGS and
DISTCHECK_CONFIGURE_FLAGS but that would be hack. I think it would be
better to issue a warning if colord wasn't found rather than error out, or
flip the logic so that the user must enable colord support, and only then
error out.  The same goes for libunwind.

I just submitted a patch that causes a missing colord or libunwind to issue
a warning rather than error out.

It is not an automagic dependency (which automatically detect the package’s
 presence), because it is more work for the developer to add the autotools
 logic to do so. Also, it is much more work to make packagers happy
 (packagers hate automagic dependencies, it makes either more work by
 patching or hard-dependency on optional features).

 A little configure switch, and you are done, nothing to complain about. :-)


The configure switch in question doesn't appear to be enough to keep some
of us from complaining.  :)

Thanks,
-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] configure.ac: Do not make missing colord or libunwind a hard failure

2013-06-03 Thread Othman, Ossama
Hi Daniel,

On Mon, Jun 3, 2013 at 11:45 AM, Daniel Stone dan...@fooishbar.org wrote:

 The usual pattern here is to set the default to 'auto', which will
 check whether or not the dependency is installed and select yes or no
 accordingly.  If someone explicitly passes --enable-colord and it's
 not installed, we want the configure run to fail, rather than doing
 something other than what they told us to.


Good point.  Armin's patch - which I missed before posting mine - is in a
better position to do just that.

Thanks!
-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] wfits: run without superuser

2013-05-31 Thread Othman, Ossama
Hi,

On Fri, May 31, 2013 at 8:14 AM, Martin Minarik 
minari...@student.fiit.stuba.sk wrote:

 diff --git a/src/extensions/weston/weston-wfits.cpp
 b/src/extensions/weston/weston-wfits.cpp
 index a54e0fe..96cf617 100644
 --- a/src/extensions/weston/weston-wfits.cpp
 +++ b/src/extensions/weston/weston-wfits.cpp
 @@ -42,6 +42,10 @@ extern C {
  #undef private
  }

 +extern C {
 +#include weston/evdev.h
 +}


Header files that could be potentially exposed to C++ really should be C++
friendly.  If evdev.h is going to be exported as part of the Weston SDK it
should contain the appropriate extern C block.  Something like the
following should work:

diff --git a/src/evdev.h b/src/evdev.h
index eb5c868..46a0798 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -26,6 +26,10 @@
 #include linux/input.h
 #include wayland-util.h

+#ifdef  __cplusplus
+extern C {
+#endif
+
 #define MAX_SLOTS 16

 enum evdev_event_type {
@@ -124,4 +128,9 @@ void
 evdev_notify_keyboard_focus(struct weston_seat *seat,
struct wl_list *evdev_devices);

+#ifdef  __cplusplus
+}
+#endif
+
 #endif /* EVDEV_H */


You then won't need to wrap the #include weston/evdev.h with an extern
C block.

-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] fix module_init signature in module tests

2013-05-17 Thread Othman, Ossama
Hi Artie,

Sorry about that.  I didn't realize some Weston binaries were only built
under the check target.   I'll run make distcheck the next time around.

Thanks for the fix!
-Ossama



On Fri, May 17, 2013 at 6:12 AM, U. Artie Eoff ullysses.a.e...@intel.comwrote:

 From: U. Artie Eoff ullysses.a.e...@intel.com

 surface-global-test and surface-test did not get updated to
 the new module_init(...) signature when it changed in
 a50e6e4c500e3080b8df7ec14c7e42741477a423.  Thus, they
 failed to compile.  Simply running 'make check' shows the
 problem. This patch fixes it.

 fixes https://bugs.freedesktop.org/show_bug.cgi?id=64691

 Signed-off-by: U. Artie Eoff ullysses.a.e...@intel.com
 ---
  tests/surface-global-test.c | 3 +--
  tests/surface-test.c| 3 +--
  2 files changed, 2 insertions(+), 4 deletions(-)

 diff --git a/tests/surface-global-test.c b/tests/surface-global-test.c
 index 5bafa08..220cb51 100644
 --- a/tests/surface-global-test.c
 +++ b/tests/surface-global-test.c
 @@ -67,8 +67,7 @@ surface_to_from_global(void *data)
  }

  WL_EXPORT int
 -module_init(struct weston_compositor *compositor,
 -   int *argc, char *argv[], const char *config_file)
 +module_init(struct weston_compositor *compositor, int *argc, char *argv[])
  {
 struct wl_event_loop *loop;

 diff --git a/tests/surface-test.c b/tests/surface-test.c
 index 8157e33..73ee23c 100644
 --- a/tests/surface-test.c
 +++ b/tests/surface-test.c
 @@ -50,8 +50,7 @@ surface_transform(void *data)
  }

  WL_EXPORT int
 -module_init(struct weston_compositor *compositor,
 -   int *argc, char *argv[], const char *config_file)
 +module_init(struct weston_compositor *compositor, int *argc, char *argv[])
  {
 struct wl_event_loop *loop;

 --
 1.7.11.7

 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Othman, Ossama
Hi Kristian,

I've attached the patch since the patch I sent through git send-mail was
sent through an e-mail account that isn't subscribed to this list (waiting
for moderator approval), and to make sure the spacing isn't munged again.
 This patch was generated against weston master as of this morning.

Sorry for the churn.
-Ossama



On Tue, May 14, 2013 at 7:05 AM, Kristian Høgsberg hoegsb...@gmail.comwrote:

 On Mon, May 13, 2013 at 11:41 PM, Othman, Ossama
 ossama.oth...@intel.com wrote:
  Hi Kristian,
 
  I think it's good to go - however, inlining the patch messed up the
  whitespace.  Ideally, send patches using git send-email, which can be
  configured to use smtp servers, and you can pass --annotate if you
  want to add a message or comment to the patch (put it after the ---
  that indicates the end of the commit message).  Or as a last resort,
  attach the patch.
 
 
  I forgot to attach the patch this last time around.  Sorry about that.
  I'll
  just resend the patch with git send-email, as you suggest.
 
 
  As for the next thing, good catch.  I'd do something like
 
  for (p = config_dirs; p != NULL; p = next) {
  next = strchrnul(p, ':');
  if (*next == ':')
  next++;
 
  ...
 
  to keep the for (...) more readable.
 
 
  Changing the loop termination to p != NULL causes an infinite loop
 since
  strchnul() returns a pointer to the null character '\0', not the NULL

 Yeah, sorry for the confusion, for a second while writing the email I
 was thinking that we could just use strchr instead and test for p !=
 NULL, but that doesn't work for getting the end of the last path
 element.

  pointer.  Also, the moving the next pointer past the colon must be done
  after path construction, other the colon ends up at the end of the path.
  How's this instead:
 
  for (p = config_dirs; *p != '\0'; p = next) {
  next = strchrnul(p, ':');
  snprintf(path, sizeof path,
  %.*s/weston/%s, (int)(next - p), p, name);
  fd = open(path, O_RDONLY | O_CLOEXEC);
  if (fd = 0)
  return fd;
 
  if (*next == ':')
  next++;
  }
 
  Note that I also had to cast next - p in the snprintf() call to int
 since
  the format specifier %*.s wants an int but the pointer difference on
 my 64
  bit Ubuntu box is a long int, at least according to the format specifier
  warning I get:
 
  foo.c: In function ‘open_config_file’:
  foo.c:53:5: warning: field precision specifier ‘.*’ expects argument of
 type
  ‘int’, but argument 4 has type ‘long int’ [-Wformat]
 
  foo.c in this case is a simple test program I wrote.  I assume the cast
 is
  safe since next - p should always fall within the range of type int.
 
  Anyway, I'll resend the patch with the above changes with git send-email.

 Yup, that all sounds good.

 thanks,
 Kristian
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel



0001-config-parser-Honor-XDG_CONFIG_DIRS.patch
Description: Binary data
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Othman, Ossama
I've revised the patch to build a list of possible filenames as Bill
suggested.  This time around I've included a patch for the man page, as
well.

Thanks!
-Ossama

---

Search for a given config file in the directories listed in
$XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config.
This allows packages to install custom config files in
/etc/xdg/weston, for example, thus allowing them to avoid dealing with
home directories.

Signed-off-by: Ossama Othman ossama.oth...@intel.com
---
 man/weston.ini.man |   12 +++-
 shared/config-parser.c |  155
+---
 2 files changed, 142 insertions(+), 25 deletions(-)

diff --git a/man/weston.ini.man b/man/weston.ini.man
index 2287730..d37654a 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -24,7 +24,10 @@ server is started:
 .nf
 .BR $XDG_CONFIG_HOME/weston.ini(if $XDG_CONFIG_HOME is set)
 .BR $HOME/.config/weston.ini   (if $HOME is set)
-.BR current dir/weston.ini   (if both variables were not set)
+.B  weston/weston.ini in each
+.BR \ \ \ \ $XDG_CONFIG_DIR(if $XDG_CONFIG_DIRS is set)
+.BR /etc/xdg/weston/weston.ini (if $XDG_CONFIG_DIRS is not set)
+.BR current dir/weston.ini   (if no variables were set)
 .fi
 .RE
 .PP
@@ -32,7 +35,12 @@ where environment variable
 .B $HOME
 is the user's home directory, and
 .B $XDG_CONFIG_HOME
-is the user specific configuration directory.
+is the user specific configuration directory, and
+.B $XDG_CONFIG_DIRS
+is a colon
+.B ':'
+delimited listed of configuration base directories, such as
+.BR /etc/xdg-foo:/etc/xdg .
 .PP
 The
 .I weston.ini
diff --git a/shared/config-parser.c b/shared/config-parser.c
index 10ff86a..4ebd453 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -25,6 +25,7 @@
 #include stdlib.h
 #include assert.h
 #include ctype.h
+#include unistd.h

 #include config-parser.h

@@ -95,6 +96,9 @@ parse_config_file(const char *path,
  const struct config_section *current = NULL;
  int i;

+ if (path == NULL)
+ return -1;
+
  fp = fopen(path, r);
  if (fp == NULL) {
  fprintf(stderr, couldn't open %s\n, path);
@@ -151,37 +155,142 @@ parse_config_file(const char *path,
  return 0;
 }

-char *
-config_file_path(const char *name)
+struct config_info
 {
- const char dotconf[] = /.config/;
- const char *config_dir;
- const char *home_dir;
+ /* Array of config file paths. */
+ char **paths;
+
+ /* Number of elements in the paths array. */
+ size_t count;
+};
+
+static char *
+allocate_config_file_path(struct config_info *info, size_t path_size)
+{
+ char **paths;
  char *path;
- size_t size;
-
- config_dir = getenv(XDG_CONFIG_HOME);
- if (!config_dir) {
- home_dir = getenv(HOME);
- if (!home_dir) {
- fprintf(stderr, HOME is not set, using cwd.\n);
- return strdup(name);
+
+ if (!info)
+ return 0;
+
+ path = malloc(path_size);
+ if (path) {
+ paths = realloc(info-paths,
+ (info-count + 1) * sizeof(*(info-paths)));
+ if (paths) {
+ paths[info-count] = path;
+ info-paths = paths;
+ ++info-count;
+ } else {
+ free(path);
+ path = NULL;
  }
+ }
+
+ return path;
+}
+
+char *
+config_file_path(const char *name)
+{
+ const char *config_dir  = getenv(XDG_CONFIG_HOME);
+ const char *home_dir = getenv(HOME);
+ const char *config_dirs = getenv(XDG_CONFIG_DIRS);
+ static const char weston_dir[] = /weston/;
+ static const char cwd[] = ./;
+ static const int DEFAULT_DIR_COUNT = 5;
+ struct config_info info;
+ size_t name_len, size;
+ char *path, *dir, *saveptr, *tmp_dirs;
+ char **p;
+
+ info.count = 0;
+ info.paths = malloc(DEFAULT_DIR_COUNT * sizeof(char *));
+ if (info.paths == NULL)
+ return NULL;
+
+ name_len = strlen(name);

- size = strlen(home_dir) + sizeof dotconf + strlen(name);
- path = malloc(size);
- if (!path)
- return NULL;
+ /* Precedence is given to config files in the home directory,
+ * and then to directories listed in XDG_CONFIG_DIRS and
+ * finally to the current working directory. */

- snprintf(path, size, %s%s%s, home_dir, dotconf, name);
- return path;
+ /* $XDG_CONFIG_HOME */
+ if (config_dir) {
+ size = strlen(config_dir) + 1 + name_len + 1;
+ path = allocate_config_file_path(info, size);
+
+ if (path)
+ snprintf(path, size, %s/%s, config_dir, name);
  }

- size = strlen(config_dir) + 1 + strlen(name) + 1;
- path = malloc(size);
- if (!path)
+ /* $HOME/.config */
+ if (home_dir) {
+ static const char dotconf[] = /.config/;
+
+ size = strlen(home_dir) + sizeof dotconf + name_len;
+ path = allocate_config_file_path(info, size);
+
+ if (path)
+ snprintf(path, size, %s%s%s,
+ home_dir, dotconf, name);
+ }
+
+ /* For each $XDG_CONFIG_DIRS: weston/config_file */
+ if (!config_dirs)
+ config_dirs = /etc/xdg;  /* See XDG base dir spec. */
+
+ size = strlen(config_dirs) + 1;
+ tmp_dirs = malloc(size);
+ if (!tmp_dirs)
  return NULL;

- snprintf(path, size, %s/%s, config_dir, name);
+ /* strtok_r() modifies the first argument.  Avoid
+ * clobbering the process environment. */
+ strncpy(tmp_dirs, 

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Othman, Ossama
Hi Kristian,

On Sun, May 12, 2013 at 8:54 AM, Kristian Høgsberg k...@bitplanet.netwrote:

 I think we can change the interface to int open_config_file(const char
 *), which looks up and opens the config file and returns the fd.  We
 can keep that in weston_compositor instead of the config_file path.
 The parse function can then fseek on the fd to reset to the beginning
 of the file.  Going forward, we'll do something like this:


 http://lists.freedesktop.org/archives/wayland-devel/2013-April/008333.html


Nice set of changes!


 and store the weston_config object in weston_compositor object.  The
 config path patch here is somewhat orthogonal to that though.

 On Sun, May 12, 2013 at 2:20 AM, Othman, Ossama ossama.oth...@intel.com
 wrote:

...

  + info.count = 0;
  + info.paths = malloc(DEFAULT_DIR_COUNT * sizeof(char *));
  + if (info.paths == NULL)
  + return NULL;

 I don't think this function should need any mallocs at all.


Agreed.  I was a bit too loose with the malloc()s.  :)

Basically
 we should be able to say something like

   char path[PATHMAX];

   snprintf(path, size, %s%s%s, home_dir, dotconf, name);
   fd = open(path);
   if (fd = 0)
 return fd;

   /* same for XDG_CONFIG_DIR */

 as for XDG_CONFIG_PATHS, I'd just scan through the string manually
 with strchrnul instead of bothering with copying and strtok_r:

   for (p = config_dirs, *p; p = next) {
 next = strchrnul(p, ':');
 snprintf(path, size, %s/weston/%s, p next - p, name);
 fd = open(path);


That is indeed much better.  Since your new parser is pending would you
like me to hold off submitting a reworked patch that incorporates your
suggestions?

Thanks to both you and Bill for the excellent feedback!
-Ossama
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Othman, Ossama
Search for a given config file in the directories listed in
$XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config.
This allows packages to install custom config files in
/etc/xdg/weston, for example, thus allowing them to avoid dealing with
home directories.

Signed-off-by: Ossama Othman ossama.oth...@intel.com
---
 shared/config-parser.c |  125
+++-
 1 file changed, 102 insertions(+), 23 deletions(-)

diff --git a/shared/config-parser.c b/shared/config-parser.c
index 10ff86a..34c16a6 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -25,6 +25,7 @@
 #include stdlib.h
 #include assert.h
 #include ctype.h
+#include unistd.h

 #include config-parser.h

@@ -95,6 +96,9 @@ parse_config_file(const char *path,
  const struct config_section *current = NULL;
  int i;

+ if (path == NULL)
+ return -1;
+
  fp = fopen(path, r);
  if (fp == NULL) {
  fprintf(stderr, couldn't open %s\n, path);
@@ -151,37 +155,112 @@ parse_config_file(const char *path,
  return 0;
 }

+static char *
+config_file_path_xdg_config_home(const char *name)
+{
+ const char *config_dir = getenv(XDG_CONFIG_HOME);
+
+ if (config_dir) {
+ size_t size = strlen(config_dir) + 1 + strlen(name) + 1;
+ char *path = malloc(size);
+
+ /* TOCTOU race here.  Ideally we should open the file
+ * and return a handle to it. */
+ if (path 
+snprintf(path, size, %s/%s, config_dir, name)  0 
+access(path, R_OK) == 0)
+ return path;
+
+ free(path);
+ }
+
+ return NULL;
+}
+
+static char *
+config_file_path_home(const char *name)
+{
+ const char *home_dir = getenv(HOME);
+
+ if (home_dir) {
+ const char dotconf[] = /.config/;
+
+ size_t size = strlen(home_dir) + sizeof dotconf + strlen(name);
+ char *path = malloc(size);
+
+ if (path 
+snprintf(path, size, %s%s%s,
+ home_dir, dotconf, name)  0 
+access(path, R_OK) == 0)
+ return path;
+
+ free(path);
+ }
+
+ return NULL;
+}
+
+static char *
+config_file_path_xdg_config_dirs(const char *name)
+{
+ const char *config_dirs = getenv(XDG_CONFIG_DIRS);
+
+ if (config_dirs) {
+ const char weston_dir[] = /weston/;
+ char *config_dir, *saveptr, *dirs;
+ char *path = NULL;
+ size_t size;
+
+ size = strlen(config_dirs) + 1;
+ dirs = malloc(size);
+ if (!dirs)
+ return NULL;
+
+ /* strtok_r() modifies the first argument.  Avoid
+ * clobbering the process environment. */
+ strncpy(dirs, config_dirs, size);
+
+ for (config_dir = strtok_r(dirs, :, saveptr);
+ config_dir != NULL;
+ config_dir = strtok_r(NULL, :, saveptr)) {
+ size = strlen(config_dir) +
+ sizeof weston_dir + strlen(name);
+ path = realloc(path, size);
+
+ if (path 
+snprintf(path, size, %s%s%s,
+ config_dir, weston_dir, name)  0 
+access(path, R_OK) == 0)
+ return path;
+ }
+
+ free(path);
+ }
+
+ return NULL;
+}
+
 char *
 config_file_path(const char *name)
 {
- const char dotconf[] = /.config/;
- const char *config_dir;
- const char *home_dir;
  char *path;
- size_t size;
-
- config_dir = getenv(XDG_CONFIG_HOME);
- if (!config_dir) {
- home_dir = getenv(HOME);
- if (!home_dir) {
- fprintf(stderr, HOME is not set, using cwd.\n);
- return strdup(name);
- }

- size = strlen(home_dir) + sizeof dotconf + strlen(name);
- path = malloc(size);
- if (!path)
- return NULL;
+ /* Precedence is given to config files in the home directory,
+ * and then to directories listed in XDG_CONFIG_DIRS. */

- snprintf(path, size, %s%s%s, home_dir, dotconf, name);
- return path;
- }
+ path = config_file_path_xdg_config_home(name);
+
+ if (!path)
+ path = config_file_path_home(name);
+
+ if (!path)
+ path = config_file_path_xdg_config_dirs(name);

- size = strlen(config_dir) + 1 + strlen(name) + 1;
- path = malloc(size);
  if (!path)
- return NULL;
+ fprintf(stderr,
+ config file \%s\ not found in 
+ $XDG_CONFIG_{HOME,DIRS} or ~/.config\n,
+ name);

- snprintf(path, size, %s/%s, config_dir, name);
  return path;
 }
-- 
1.7.10.4


0001-config-parser-Honor-the-XDG_CONFIG_DIRS-environment-.patch
Description: Binary data
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel