mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
Fix AppImage share path
This commit is contained in:
parent
a45fd094ad
commit
18fe4375d4
@ -16,15 +16,16 @@
|
|||||||
|
|
||||||
void set_appimage_symlink(char* argv0)
|
void set_appimage_symlink(char* argv0)
|
||||||
{
|
{
|
||||||
char* path = strdup(argv0);
|
char* path = realpath("/proc/self/exe", NULL);
|
||||||
char* i = strrchr(path, '/');
|
char* i = strrchr(path, '/');
|
||||||
*(i+1) = '\0';
|
*(i+1) = '\0';
|
||||||
char* dest = strcat(path, "usr/");
|
char* dest = strcat(path, "../");
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (lstat(PREFIX, &buf) == 0 && S_ISLNK(buf.st_mode)) {
|
if (lstat(PREFIX, &buf) == 0 && S_ISLNK(buf.st_mode)) {
|
||||||
remove(PREFIX);
|
remove(PREFIX);
|
||||||
}
|
}
|
||||||
symlink(dest, PREFIX);
|
symlink(dest, PREFIX);
|
||||||
|
printf("'%s' '%s' '%s'\n", path, i, dest);
|
||||||
free(path);
|
free(path);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user