Skip to content

Commit d752b32

Browse files
committed
address comments
1 parent 95353ec commit d752b32

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
It didn't work well together with the existing inplace version of the same proc
2626
(`tables.merge(var CountTable, CountTable)`).
2727
It was an oversight to be included in v1.0.
28-
28+
- `relativePath("foo", "foo")` is now `"."`, not `""`, as `""` means invalid path
29+
and shouldn't be conflated with `"."`; use -d:nimOldRelativePathBehavior to restore the old
30+
behavioe
2931

3032
### Breaking changes in the compiler
3133

lib/pure/os.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ proc relativePath*(path, base: string; sep = DirSep): string {.
417417
if not f.hasNext(path): break
418418
ff = f.next(path)
419419

420-
if result.len == 0: result.add "."
420+
when not defined(nimOldRelativePathBehavior):
421+
if result.len == 0: result.add "."
421422

422423
proc isRelativeTo*(path: string, base: string): bool {.since: (1, 1).} =
423424
## Returns true if `path` is relative to `base`.

0 commit comments

Comments
 (0)