Skip to content

Commit 3b686fd

Browse files
committed
make relative paths work in -serving_dir
fixes #152
1 parent 07bbb45 commit 3b686fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/debiman/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ func main() {
197197
// All of our .so references are relative to *servingDir. For
198198
// mandoc(1) to find the files, we need to change the working
199199
// directory now.
200+
//
201+
// We turn *servingDir into an absolute path so that it still refers to the
202+
// same location even after our os.Chdir() call (see issue #152).
203+
abs, err := filepath.Abs(*servingDir)
204+
if err != nil {
205+
log.Fatal(err)
206+
}
207+
*servingDir = abs
200208
if err := os.Chdir(*servingDir); err != nil {
201209
log.Fatal(err)
202210
}

0 commit comments

Comments
 (0)