diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-21 10:29:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-21 12:49:05 -0700 |
commit | c9d48c9a72eec39b614d1d59e3c9fdd66e5a3ab0 (patch) | |
tree | 2b8c8fd9da79ed7e35e088f795e0a92b5d077ecd /save-git.c | |
parent | 97386a6f3d1667f293ab621fd8ae8a3ec2bf2ef2 (diff) | |
download | subsurface-c9d48c9a72eec39b614d1d59e3c9fdd66e5a3ab0.tar.gz |
Add helper function to return local filename of picture as C string
This way we can actually find the picture that we are showing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r-- | save-git.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/save-git.c b/save-git.c index b7e519463..1914a07ee 100644 --- a/save-git.c +++ b/save-git.c @@ -628,8 +628,10 @@ static int save_one_picture(git_repository *repo, struct dir *dir, struct pictur /* next store the actual picture; we prefix all picture names * with "PIC-" to make things easier on the parsing side */ struct membuffer namebuf = { 0 }; - put_format(&namebuf, "PIC-%s", hashstring(pic->filename)); - error = blob_insert_fromdisk(repo, dir, pic->filename, mb_cstring(&namebuf)); + const char *localfn = local_file_path(pic); + put_format(&namebuf, "PIC-%s", pic->hash); + error = blob_insert_fromdisk(repo, dir, localfn, mb_cstring(&namebuf)); + free((void *)localfn); } return error; } |