ReactOS 0.4.15-dev-8219-ge8b88cf
makepath.c File Reference
#include <precomp.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for makepath.c:

Go to the source code of this file.

Functions

void _makepath (char *path, const char *drive, const char *dir, const char *fname, const char *ext)
 

Function Documentation

◆ _makepath()

void _makepath ( char path,
const char drive,
const char dir,
const char fname,
const char ext 
)

Definition at line 21 of file makepath.c.

22{
23 char *p = path;
24
25 if ( !path )
26 return;
27
28 if (drive && drive[0])
29 {
30 *p++ = drive[0];
31 *p++ = ':';
32 }
33 if (dir && dir[0])
34 {
35 size_t len = strlen(dir);
36 memmove(p, dir, len);
37 p += len;
38 if (p[-1] != '/' && p[-1] != '\\')
39 *p++ = '\\';
40 }
41 if (fname && fname[0])
42 {
43 size_t len = strlen(fname);
44 memmove(p, fname, len);
45 p += len;
46 }
47 if (ext && ext[0])
48 {
49 if (ext[0] != '.')
50 *p++ = '.';
51 strcpy(p, ext);
52 }
53 else
54 *p = '\0';
55}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int dir
Definition: maze.c:112
static const WCHAR *const ext[]
Definition: module.c:53
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
#define memmove(s1, s2, n)
Definition: mkisofs.h:881