linux lib compatibility

This commit is contained in:
2026-06-03 09:20:00 +02:00
parent cec92cacd1
commit 564292b03e
16 changed files with 75 additions and 166 deletions
+7 -8
View File
@@ -11,8 +11,6 @@
#include <libgen.h>
#include "include/utils.h"
#include "include/buffer.h"
#include "include/split_screen.h"
#include <string.h>
@@ -26,13 +24,15 @@
#include "include/completion.h"
#include <signal.h>
#include "include/utils.h"
struct editorConfig E;
int main(int argc, char *argv[]) {
char * splash_screen = bAlloc(sizeof(char) * 512);
char * splash_screen = strdup(getenv("HOME"));
int home_path_len = (int) strlen(splash_screen);
char * splash_screen_relative_path = strdup("/.beluga/assets/beluga.txt");
int splash_screen_relative_path_len = (int) strlen(splash_screen_relative_path);
signal(SIGPIPE, SIG_IGN); // don't die on broken pipe, just get EPIPE from write()
@@ -41,8 +41,9 @@ int main(int argc, char *argv[]) {
EditorPane *active = splitScreenGetActivePane();
struct buffer_t *buf;
strcat(splash_screen, getenv("HOME"));
splash_screen = realloc(splash_screen, sizeof(char) * (home_path_len + splash_screen_relative_path_len + 1));
strcat(splash_screen, "/.beluga/assets/beluga.txt");
free(splash_screen_relative_path);
appDebug("splash : %s\n", splash_screen);
active->buffer_id = bufferCreate(splash_screen, READ_ONLY);
@@ -59,12 +60,10 @@ int main(int argc, char *argv[]) {
}
bFree(splash_screen);
free(splash_screen);
editorSetStatusMessage("HELP: Ctrl-x Ctrl-s = save | Ctrl-x Ctrl-c = quit");
appDebug("allocation : %d\n", beluga_alloc_counter);
while (1) {
editorRefreshScreen();
editorProcessKeypress();