/[gentoo-x86]/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
Gentoo

Contents of /net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sun Feb 16 19:17:40 2014 UTC (4 years, 7 months ago) by pacho
Branch: MAIN
CVS Tags: HEAD
Apply some Fedora patches that also fix Logitech DiNovo Edge keyboard (#501120 by manwe)

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)

1 pacho 1.1 From f7861d27fbcbc519f57d8496aa9486f487908821 Mon Sep 17 00:00:00 2001
2     From: Bastien Nocera <hadess@hadess.net>
3     Date: Sat, 9 Nov 2013 18:13:43 +0100
4     Subject: [PATCH 1/5] obex: Use GLib helper function to manipulate paths
5    
6     Instead of trying to do it by hand. This also makes sure that
7     relative paths aren't used by the agent.
8     ---
9     obexd/src/manager.c | 10 +++++-----
10     1 file changed, 5 insertions(+), 5 deletions(-)
11    
12     diff --git a/obexd/src/manager.c b/obexd/src/manager.c
13     index cec8a39..f18896e 100644
14     --- a/obexd/src/manager.c
15     +++ b/obexd/src/manager.c
16     @@ -651,14 +651,14 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
17     DBUS_TYPE_STRING, &name,
18     DBUS_TYPE_INVALID)) {
19     /* Splits folder and name */
20     - const char *slash = strrchr(name, '/');
21     + gboolean is_relative = !g_path_is_absolute(name);
22     DBG("Agent replied with %s", name);
23     - if (!slash) {
24     - agent->new_name = g_strdup(name);
25     + if (is_relative) {
26     + agent->new_name = g_path_get_basename(name);
27     agent->new_folder = NULL;
28     } else {
29     - agent->new_name = g_strdup(slash + 1);
30     - agent->new_folder = g_strndup(name, slash - name);
31     + agent->new_name = g_path_get_basename(name);
32     + agent->new_folder = g_path_get_dirname(name);
33     }
34     }
35    
36     --
37     1.8.4.2
38    

  ViewVC Help
Powered by ViewVC 1.1.20