nfs-ganesha 1.4

fsal_common.c

Go to the documentation of this file.
00001 /*
00002  * vim:expandtab:shiftwidth=8:tabstop=8:
00003  */
00004 
00009 #ifdef HAVE_CONFIG_H
00010 #include "config.h"
00011 #endif
00012 
00013 #include <string.h>
00014 #include "fsal_common.h"
00015 #include "fsal_internal.h"
00016 
00017 void FSAL_internal_append_path(char *tgt, char *parent, char *child)
00018 {
00019   size_t len;
00020 
00021   len = strlen(parent);
00022 
00023   if((len > 0) && (parent[len - 1] != '/'))
00024     snprintf(tgt, FSAL_MAX_PATH_LEN, "%s/%s", parent, child);
00025   else
00026     snprintf(tgt, FSAL_MAX_PATH_LEN, "%s%s", parent, child);
00027 
00028 }