|
|
1.1 root 1: /* Copyright (C) 2004 TrueCrypt Team, truecrypt.org
2: This product uses components written by Paul Le Roux <[email protected]> */
3:
4: #include "TCdefs.h"
5:
6: #include <ctype.h>
7:
8: #include "uncroot.h"
9:
10: char *
11: MakeRootName (char *lpszDest, char *lpszSrc)
12: {
13: strcpy (lpszDest, lpszSrc);
14:
15: if (lpszDest[1] == ':' && isalpha (lpszDest[0]))
16: lpszDest[3] = 0;/* Straight drive letter */
17: else
18: {
19: if (lpszDest[0] == '\\' && lpszDest[1] == '\\')
20: {
21: char *p = strchr (lpszDest + 2, '\\');
22: if (p != NULL)
23: {
24: p = strchr (p + 1, '\\');
25: if (p != NULL)
26: *(p + 1) = 0; /* UNC + path */
27: else
28: {
29: strcat (lpszDest, "\\"); /* UNC + share name no
30: path */
31: }
32: }
33: else
34: lpszDest[1] = 0;
35: }
36: else
37: lpszDest[1] = 0; /* Default drive letter */
38: }
39:
40: return lpszDest;
41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.