From d057a7cea4b970b9aae6a20a50008aba227c94a6 Mon Sep 17 00:00:00 2001 From: Dave Koziol Date: Tue, 6 Mar 2001 21:02:08 +0000 Subject: [PATCH] STABLE10-drive-letter-tabs-for-submounts-containing-string-afs-20010119 "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." (cherry picked from commit b05deccb9f57df04cc933a94dec2be96dcbadb87) --- src/WINNT/client_config/drivemap.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/WINNT/client_config/drivemap.cpp b/src/WINNT/client_config/drivemap.cpp index 0fadf3ad5..0b08e8eae 100644 --- a/src/WINNT/client_config/drivemap.cpp +++ b/src/WINNT/client_config/drivemap.cpp @@ -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); -- 2.39.5