]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
drive-letter-tabs-for-submounts-containing-string-afs-20010119
authorDave Koziol <dkoziol@dragonflymobile.com>
Fri, 19 Jan 2001 23:44:04 +0000 (23:44 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 19 Jan 2001 23:44:04 +0000 (23:44 +0000)
"The following patch is to addresses problems with the Drive Letters tabs in
the AFS Client and AFS Control Panel when using submounts which start with
the letters afs.  We had a test cell up and running with a name that started
with afs01 and this caused the afs client to misbehave."

src/WINNT/client_config/drivemap.cpp

index 0fadf3ad5e3574f293f057023fd8a2659077255c..0b08e8eae86b733c49c647ffbe4c7974d839d5f1 100644 (file)
@@ -684,9 +684,14 @@ void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWa
       lstrcpy (pszTarget, (fWantAFS) ? TEXT("/afs") : TEXT(""));
    else if ((*pszSource != TEXT('/')) && (*pszSource != TEXT('\\')))
       wsprintf (pszTarget, TEXT("/afs/%s"), pszSource);
-   else if (fWantAFS && lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+   // We don't want to strip afs off the start if it is part of something for example afscell.company.com
+   else if (fWantAFS && (lstrncmpi (&pszSource[1], TEXT("afs"), 3)) || !((pszSource[4] == TEXT('/')) ||
+                                                                         (pszSource[4] == TEXT('\\')) ||
+                                                                         (lstrlen(pszSource) == 4)))
       wsprintf (pszTarget, TEXT("/afs%s"), pszSource);
-   else if (!fWantAFS && !lstrncmpi (&pszSource[1], TEXT("afs"), 3))
+   else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) || ((pszSource[4] == TEXT('/')) ||
+                                                                        (pszSource[4] == TEXT('\\')) ||
+                                                                        (lstrlen(pszSource) == 4))))
       lstrcpy (pszTarget, &pszSource[4]);
    else
       lstrcpy (pszTarget, pszSource);