mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Dont prevent kitty fro starting on failure to read macos-launch-services-cmdline
Fixes #8581
This commit is contained in:
@@ -45,8 +45,9 @@ get_argv_from(const char *filename, const char *argv0, argv_array *final_ans) {
|
||||
size_t src_sz;
|
||||
char* src = read_full_file(filename, &src_sz);
|
||||
if (!src) {
|
||||
if (errno == ENOENT || errno == ENOTDIR) return true;
|
||||
fprintf(stderr, "Failed to read from %s ", filename); perror("with error");
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
ShlexState s = {0};
|
||||
argv_array ans = {0};
|
||||
|
||||
@@ -215,7 +215,9 @@ safe_read_stream(void* ptr, size_t size, FILE* stream) {
|
||||
|
||||
static char*
|
||||
read_full_file(const char* filename, size_t *sz) {
|
||||
FILE* file = fopen(filename, "rb");
|
||||
FILE* file = NULL;
|
||||
errno = EINTR;
|
||||
while (file == NULL && errno == EINTR) file = fopen(filename, "rb");
|
||||
if (!file) return NULL;
|
||||
fseek(file, 0, SEEK_END);
|
||||
unsigned long file_size = ftell(file);
|
||||
|
||||
Reference in New Issue
Block a user