From b05deccb9f57df04cc933a94dec2be96dcbadb87 Mon Sep 17 00:00:00 2001 From: Dave Koziol Date: Fri, 19 Jan 2001 23:44:04 +0000 Subject: [PATCH] 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." --- 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 0fadf3a..0b08e8e 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); -- 1.9.4