Skip to content

~/.local/share/tig/history may not be used since version 2.5.6 #1215

@yan12125

Description

@yan12125

Since 2.5.6 (d308b74, particularly), if $XDG_DATA_HOME is valid, tig runs mkdir(dirname(path), 0777);. However, dirname() may modify the string pointed to by path [1]. If that happens, path no longer points to the desired history file.

For example, on Arch LInux, dirname() changes path from

"/home/yen/.local/share/tig/history\0"

to

"/home/yen/.local/share/tig\0history\0"

The following open() fails as path is now a directory, and the fallback ~/.tig_history is used.

By the way, is it a good idea to use permission 0777?

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirname.html

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions