#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libant/DirCombine.c $ %D% SwRI" /* DirCombine.c -- combine Dir and DirPart in Dir */ #include /* for strcmp,etc. */ /* DirCombine -- combine Dir and DirPart in Dir */ void DirCombine( char *Dir, /* nonempty absolute dir path */ char *DirPart) /* adjustment */ { if (!strcmp(Dir,"/")) { if (strcmp(DirPart,"..")) strcat(Dir,DirPart); } else if (!strcmp(DirPart,"..")) *(strrchr(Dir,'/')) = '\0'; else strcat(strcat(Dir,"/"),DirPart); if (!Dir[0]) strcpy(Dir,"/"); }