Since every API builds its patch via build_path, updating that
function should be enough.

Changes from v1:
1. Append the namespace only if it is defined. This will remove an
additional "/" which would be introduced otherwise.

Signed-off-by: Dhaval Giani <[email protected]>

---
 src/api.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: libcg/src/api.c
===================================================================
--- libcg.orig/src/api.c
+++ libcg/src/api.c
@@ -816,7 +816,13 @@ static char *cg_build_path_locked(char *
                 * XX: Change to snprintf once you figure what n should be
                 */
                if (strcmp(cg_mount_table[i].name, type) == 0) {
-                       sprintf(path, "%s/", cg_mount_table[i].path);
+                       if (cg_namespace_table[i]) {
+                               sprintf(path, "%s/%s/", cg_mount_table[i].path,
+                                                       cg_namespace_table[i]);
+                       } else {
+                               sprintf(path, "%s/", cg_mount_table[i].path);
+                       }
+
                        if (name) {
                                char *tmp;
                                tmp = strdup(path);



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to