@@ -140,26 +140,27 @@ proc expandTilde*(path: string): string {.
140
140
elif (path[1 ] in {DirSep , AltSep }):
141
141
tryGetHomeOrRet
142
142
result = result / path.substr (2 )
143
- elif compiles (getHomeDir (" bob" )):
144
- # handle path beginning with `~bob` and `~bob/`
145
- # which means home of bob
146
- var i = path.find (DirSep , 1 )
147
- if i < 0 :
148
- i = len (path)
143
+ else :
144
+ when compiles (getHomeDir (" bob" )):
145
+ # handle path beginning with `~bob` and `~bob/`
146
+ # which means home of bob
147
+ var i = path.find (DirSep , 1 )
148
+ if i < 0 :
149
+ i = len (path)
149
150
150
- let
151
- name = path[1 ..< i]
152
- userhome = getHomeDir (name)
151
+ let
152
+ name = path[1 ..< i]
153
+ userhome = getHomeDir (name)
153
154
154
- if userhome == " " and hostOS == " vsworks" :
155
- # XXX: As of the moment this line is written,
156
- # hostOS won't be "vsworks" yet.
157
- return path
155
+ if userhome == " " and hostOS == " vsworks" :
156
+ # XXX: As of the moment this line is written,
157
+ # hostOS won't be "vsworks" yet.
158
+ return path
158
159
159
- result = userhome & path.substr (i)
160
+ result = userhome & path.substr (i)
160
161
161
- else :
162
- result = path
162
+ else :
163
+ result = path
163
164
164
165
proc quoteShellWindows * (s: string ): string {.noSideEffect , rtl , extern : " nosp$1" .} =
165
166
# # Quote `s`, so it can be safely passed to Windows API.
0 commit comments