Page MenuHome

Fix: previous/next navigation broken for the default directory.
Needs ReviewPublic

Authored by Nicholas Rishel (nicholas_rishel) on Tue, Sep 10, 12:37 AM.



Previously BKE_appdir_folder_default would return a path
trailing slash. This funtion is only used with SpaceFile's params->dir,
where dir is normally a path with trailing slash. This change makes the
default path consistent with other uses of params->dir.

This fixes previous/next navigation where stepping "back" into the
default folder was recorded as a newly visited folder, whereup the next
folder list was reset and the previous folder list became [default
folder]->[default folder with trailing slash].

Diff Detail

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Tue, Sep 10, 10:28 AM
Brecht Van Lommel (brecht) added inline comments.

You can't edit a const char * pointer like this.

This can be solved by doing the same as the Windows case, copying to a static char documentfolder[MAXPATHLEN]; and modifying that.

This revision now requires changes to proceed.Tue, Sep 10, 10:28 AM
Nicholas Rishel (nicholas_rishel) marked an inline comment as done.EditedWed, Sep 11, 11:02 PM

Updated the commit to use BLI_add_slash instead of BLI_cleanup_dir. I'm not sure this is the right decision: I'd guess this bug might resurface if e.g. HOME points to an invalid directory causing root to be used instead though I don't check that BLI_cleanup_dir would handle that case any better. The change do BLI_add_slash resolves the tested issue on Windows and Linux.


Resolved this along with other bugs in the Linux changes.