home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES1.ZIP / LIB / mkfilenm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-11  |  2.7 KB  |  67 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       m k f i l e n a m e . c                                      */
  3. /*                                                                    */
  4. /*       Make a qualified file name from path name and simple file    */
  5. /*       name.                                                        */
  6. /*--------------------------------------------------------------------*/
  7.  
  8. /*--------------------------------------------------------------------*/
  9. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  10. /*    Wonderworks.                                                    */
  11. /*                                                                    */
  12. /*    All rights reserved except those explicitly granted by the      */
  13. /*    UUPC/extended license agreement.                                */
  14. /*--------------------------------------------------------------------*/
  15.  
  16. /*--------------------------------------------------------------------*/
  17. /*                          RCS Information                           */
  18. /*--------------------------------------------------------------------*/
  19.  
  20. /*
  21.  *    $Id: mkfilenm.c 1.3 1993/10/03 20:37:34 ahd Exp $
  22.  *
  23.  *    Revision history:
  24.  *    $Log: mkfilenm.c $
  25.  *     Revision 1.3  1993/10/03  20:37:34  ahd
  26.  *     Don't formally normalize paths, invalid file names cause normalize()
  27.  *     to panic() in BCC for OS/2
  28.  *
  29.  *     Revision 1.3  1993/10/03  20:37:34  ahd
  30.  *     Don't formally normalize paths, invalid file names cause normalize()
  31.  *     to panic() in BCC for OS/2
  32.  *
  33.  *     Revision 1.2  1993/06/16  04:03:25  ahd
  34.  *     drop duplicated slashes (caused by root directory support *sigh*)
  35.  *
  36.  */
  37.  
  38. #include <stdio.h>
  39. #include <stdlib.h>
  40. #include <string.h>
  41. #include <time.h>
  42.  
  43. /*--------------------------------------------------------------------*/
  44. /*                    UUPC/extended include files                     */
  45. /*--------------------------------------------------------------------*/
  46.  
  47. #include "hlib.h"
  48. #include "lib.h"
  49.  
  50. /*--------------------------------------------------------------------*/
  51. /*    m k f i l e n a m e                                             */
  52. /*                                                                    */
  53. /*    Build a path name out of a directory name and a file name       */
  54. /*--------------------------------------------------------------------*/
  55.  
  56. void mkfilename(char *pathname,
  57.                 const char *path,
  58.                 const char *name)
  59. {
  60.    char *s = pathname;
  61.    sprintf(pathname, "%s/%s", path, name);
  62.  
  63.    while ((s = strchr(s, '\\')) != NULL)
  64.       *s++ = '/';                             /* Normalize slashes */
  65.  
  66. } /*mkfilename*/
  67.