File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ object PathChunk extends PathChunkMacros {
2626 val splitted = strNoTrailingSeps.split('/' )
2727 splitted ++ Array .fill(trailingSeparatorsCount)(" " )
2828 }
29-
29+ private def reduceUps (in: List [String ]) = in.foldLeft(List .empty[String ]){case (acc,x) =>
30+ acc match {
31+ case h :: t if h == " .." => x :: acc
32+ case h :: t if x == " .." => t
33+ case _ => x :: acc}
34+ }.reverse
3035 private [os] def segmentsFromStringLiteralValidation (literal : String ): Array [String ] = {
3136 val stringSegments = segmentsFromString(literal)
32- val validSegmnts = validLiteralSegments(stringSegments)
37+ val validSegmnts = reduceUps( validLiteralSegments(stringSegments) )
3338 val sanitizedLiteral = validSegmnts.mkString(" /" )
3439 if (validSegmnts.isEmpty) throw InvalidSegment (
3540 literal,
You can’t perform that action at this time.
0 commit comments