home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / MNLDOS.ZIP / src / osgenaps.c < prev    next >
C/C++ Source or Header  |  2004-07-11  |  534b  |  24 lines

  1. /* $Id: osgenaps.c,v 1.2 2004/07/11 09:29:14 ozzmosis Exp $ */
  2.  
  3. /* normalize path                                      */
  4. /* It is assumed that path has one more char allocated */
  5. /* then strlen+1.                                      */
  6. char *os_append_slash(char *path)
  7. {
  8.     char *p;
  9.  
  10.     if (!path)
  11.         return NULL;
  12.  
  13.     if ((p = strchr(path, '\0')) > path)
  14.     {
  15.         p--;
  16.         if (*p != '\\' && *p != '/')
  17.         {
  18.             *(++p) = CHAR_DIRSEPARATOR;
  19.             *(++p) = '\0';
  20.         }
  21.     }
  22.     return path;
  23. }
  24.