@@ -10,7 +10,6 @@ package main
1010
1111import (
1212 "errors"
13- "fmt"
1413 "io"
1514 "os"
1615 "path/filepath"
@@ -60,23 +59,15 @@ var Conf = Configuration{
6059
6160// ConfLoad loads the program configuration
6261func ConfLoad () error {
63- // Obtain path to executable directory
64- exepath , err := os .Executable ()
65- if err != nil {
66- return fmt .Errorf ("conf: %s" , err )
67- }
68-
69- exepath = filepath .Dir (exepath )
70-
7162 // Build list of configuration files
7263 files := []string {
7364 filepath .Join (PathConfDir , ConfFileName ),
74- filepath .Join (exepath , ConfFileName ),
65+ filepath .Join (PathExecutableDir , ConfFileName ),
7566 }
7667
7768 // Load file by file
7869 for _ , file := range files {
79- err = confLoadInternal (file )
70+ err : = confLoadInternal (file )
8071 if err != nil {
8172 return err
8273 }
@@ -86,12 +77,11 @@ func ConfLoad() error {
8677 quirksDirs := []string {
8778 PathLocalQuirksDir ,
8879 PathGlobalQuirksDir ,
89- filepath .Join (exepath , "ipp-usb-quirks" ),
80+ filepath .Join (PathExecutableDir , "ipp-usb-quirks" ),
9081 }
9182
92- if err == nil {
93- Conf .Quirks , err = LoadQuirksSet (quirksDirs ... )
94- }
83+ var err error
84+ Conf .Quirks , err = LoadQuirksSet (quirksDirs ... )
9585
9686 return err
9787}
0 commit comments