|
|
1.1.1.6 root 1: /* Legal Notice: The source code contained in this file has been derived from
2: the source code of Encryption for the Masses 2.02a, which is Copyright (c)
3: 1998-99 Paul Le Roux and which is covered by the 'License Agreement for
4: Encryption for the Masses'. Modifications and additions to that source code
1.1.1.7 ! root 5: contained in this file are Copyright (c) 2004-2006 TrueCrypt Foundation and
1.1.1.6 root 6: Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.0
7: the full text of which is contained in the file License.txt included in
8: TrueCrypt binary and source code distribution archives. */
1.1 root 9:
1.1.1.6 root 10: #include "Tcdefs.h"
1.1 root 11:
12: #include <ctype.h>
13:
1.1.1.6 root 14: #include "Uncroot.h"
1.1 root 15:
16: char *
17: MakeRootName (char *lpszDest, char *lpszSrc)
18: {
19: strcpy (lpszDest, lpszSrc);
20:
21: if (lpszDest[1] == ':' && isalpha (lpszDest[0]))
22: lpszDest[3] = 0;/* Straight drive letter */
23: else
24: {
25: if (lpszDest[0] == '\\' && lpszDest[1] == '\\')
26: {
27: char *p = strchr (lpszDest + 2, '\\');
28: if (p != NULL)
29: {
30: p = strchr (p + 1, '\\');
31: if (p != NULL)
32: *(p + 1) = 0; /* UNC + path */
33: else
34: {
35: strcat (lpszDest, "\\"); /* UNC + share name no
36: path */
37: }
38: }
39: else
40: lpszDest[1] = 0;
41: }
42: else
43: lpszDest[1] = 0; /* Default drive letter */
44: }
45:
46: return lpszDest;
47: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.