Annotation of truecrypt/format/uncroot.c, revision 1.1.1.4

1.1.1.3   root        1: /* The source code contained in this file has been derived from the source code
                      2:    of Encryption for the Masses 2.02a by Paul Le Roux. Modifications and
                      3:    additions to that source code contained in this file are Copyright (c) 2004
1.1.1.4 ! root        4:    TrueCrypt Foundation and Copyright (c) 2004 TrueCrypt Team. Unmodified
1.1.1.3   root        5:    parts are Copyright (c) 1998-99 Paul Le Roux. This is a TrueCrypt Foundation
                      6:    release. Please see the file license.txt for full license details. */
1.1       root        7: 
                      8: #include "TCdefs.h"
                      9: 
                     10: #include <ctype.h>
                     11: 
                     12: #include "uncroot.h"
                     13: 
                     14: char *
                     15: MakeRootName (char *lpszDest, char *lpszSrc)
                     16: {
                     17:        strcpy (lpszDest, lpszSrc);
                     18: 
                     19:        if (lpszDest[1] == ':' && isalpha (lpszDest[0]))
                     20:                lpszDest[3] = 0;/* Straight drive letter */
                     21:        else
                     22:        {
                     23:                if (lpszDest[0] == '\\' && lpszDest[1] == '\\')
                     24:                {
                     25:                        char *p = strchr (lpszDest + 2, '\\');
                     26:                        if (p != NULL)
                     27:                        {
                     28:                                p = strchr (p + 1, '\\');
                     29:                                if (p != NULL)
                     30:                                        *(p + 1) = 0;   /* UNC + path */
                     31:                                else
                     32:                                {
                     33:                                        strcat (lpszDest, "\\");        /* UNC + share name no
                     34:                                                                           path */
                     35:                                }
                     36:                        }
                     37:                        else
                     38:                                lpszDest[1] = 0;
                     39:                }
                     40:                else
                     41:                        lpszDest[1] = 0;        /* Default drive letter */
                     42:        }
                     43: 
                     44:        return lpszDest;
                     45: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.