diff --git a/ChangeLog b/ChangeLog index 984f24f5ac..3d51aa512f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,22 @@ 2002-12-03 David Hampton + * src/scm/main.scm ((gnc:account-file-to-load)): Normalize the + path name before using it to open a config files. #90487 + + * src/scm/path.scm (gnc:load-user-config-if-needed): Write out a + new 1.8 version of the config file. Add the 1.8 version to the + list of files to try an read when reading the config. #100266 + + * src/engine/gnc-session.c (gnc_session_load): Don't erase the + just loaded account information because the backend is reporting + that the file is from a previous version. Let the caller decide + after querying the user. #97270. + + * src/gnome/window-main.c (gnc_main_window_about_cb): Put the + build date into the about box for development versions of + gnucash. #99775 + * src/register/ledger-core/split-register-control.c (gnc_split_register_move_cursor): Don't delete an empty split if its the current transaction split. Dangling pointers are no diff --git a/src/scm/main.scm b/src/scm/main.scm index 01fd827b15..7f793b5b27 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -512,12 +512,33 @@ string and 'directories' must be a list of strings." (gnc:debug "UI Shutdown hook.") (gnc:file-quit)) +(define (gnc:normalize-path file) + (let* ((parts-in (string-split file #\/)) + (parts-out '())) + + ;; Convert to a path based at the root + (if (not (string-null? (car parts-in))) + (set! parts-in (append (string-split (getenv "PWD") #\/) parts-in))) + + ;; Strip out "." and ".." components + (for-each + (lambda (part) + (cond ((string=? part ".") #f) + ((string=? part "..") (set! parts-out (cdr parts-out))) + (else (set! parts-out (cons part parts-out))))) + parts-in) + + ;; Put it back together + (string-join (reverse parts-out) "/") + ) +) + (define (gnc:account-file-to-load) (let ((ok (not (gnc:config-var-value-get gnc:*arg-no-file*))) (file (if (pair? gnc:*command-line-remaining*) (car gnc:*command-line-remaining*) (gnc:history-get-last)))) - (and ok (string? file) file))) + (and ok (string? file) (gnc:normalize-path file)))) (define (gnc:load-account-file) (let ((file (gnc:account-file-to-load)))