[Github-comments] [geany/geany] Use relative paths for project session files if base directory is relative (PR #3021)

Jiří Techet notifications at xxxxx
Thu Nov 25 15:30:28 UTC 2021


The problem with current project files, which contain absolute paths to
open documents, is, that when moved to another directory, they become
invalid.

There have been various pull requests in the past attempting to start
using relative paths, the problem was, that given Geany's flexibility
in placing the project file, which can theoretically be stored on
another drive inaccessible using relative paths, using relative paths
would break things.

This patch tries to address only one specific situation where we can
be sure relative paths work - when the user specifies the base directory
using a relative path against the project file. Since it's the user
who specifies the base path as relative and this relative path works
for him, we can be sure files within base path are reachable using
relative paths too.

Only files within the base path are stored as relative paths. Files
outside the base path are still stored as absolute paths.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3021

-- Commit Summary --

  * Use relative paths for project session files if base directory is relative

-- File Changes --

    M src/keyfile.c (39)
    M src/keyfile.h (2)
    M src/project.c (2)

-- Patch Links --

https://github.com/geany/geany/pull/3021.patch
https://github.com/geany/geany/pull/3021.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211125/6adabbff/attachment-0001.htm>


More information about the Github-comments mailing list