Experimental 'make install'
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /home/andrew/MagickaBBS/utils/magiedit
|
||||
./magiedit -D /home/andrew/MagickaBBS/node$1/dorinfo1.def -MSGTMP /home/andrew/MagickaBBS/node$1
|
||||
cd __LOCALSTATEPREFIX__/magiedit
|
||||
__EXECPREFIX__/magiedit -D __LOCALSTATEPREFIX__/node$1/dorinfo1.def -MSGTMP __LOCALSTATEPREFIX__/node$1
|
||||
|
@@ -16,6 +16,14 @@
|
||||
#include <limits.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifndef DRAFT_PATH
|
||||
#define DRAFT_PATH ""
|
||||
#endif
|
||||
|
||||
#ifndef ANSI_PATH
|
||||
#define ANSI_PATH ""
|
||||
#endif
|
||||
|
||||
char **quote_lines;
|
||||
int quote_line_count;
|
||||
|
||||
@@ -27,7 +35,6 @@ int msgpriv;
|
||||
|
||||
char *draft_filename = NULL;
|
||||
|
||||
|
||||
char *load_draft() {
|
||||
DIR *dirp;
|
||||
struct dirent *dent;
|
||||
@@ -40,7 +47,7 @@ char *load_draft() {
|
||||
int i;
|
||||
tODInputEvent ch;
|
||||
|
||||
snprintf(draft_path, PATH_MAX, "drafts/%s", od_control_get()->user_name);
|
||||
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s", od_control_get()->user_name);
|
||||
|
||||
dirp = opendir(draft_path);
|
||||
|
||||
@@ -183,7 +190,7 @@ char *load_draft() {
|
||||
|
||||
return draft_filename;
|
||||
} else if (ch.chKeyPress == 'd') {
|
||||
snprintf(draft_path, PATH_MAX, "drafts/%s/%s.draft", od_control_get()->user_name, filenames[selected]);
|
||||
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s/%s.draft", od_control_get()->user_name, filenames[selected]);
|
||||
unlink(draft_path);
|
||||
|
||||
free(filenames[selected]);
|
||||
@@ -213,7 +220,7 @@ char *load_draft() {
|
||||
void delete_draft(char *filename) {
|
||||
char draft_path[PATH_MAX];
|
||||
|
||||
snprintf(draft_path, PATH_MAX, "drafts/%s/%s.draft", od_control_get()->user_name, filename);
|
||||
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s/%s.draft", od_control_get()->user_name, filename);
|
||||
|
||||
unlink(draft_path);
|
||||
}
|
||||
@@ -233,13 +240,13 @@ int check_draft_filename(char *filename) {
|
||||
mkdir("drafts", 0700);
|
||||
}
|
||||
|
||||
snprintf(draft_path, PATH_MAX, "drafts/%s", od_control_get()->user_name);
|
||||
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s", od_control_get()->user_name);
|
||||
|
||||
if (stat(draft_path, &s) != 0) {
|
||||
mkdir(draft_path, 0700);
|
||||
}
|
||||
|
||||
snprintf(draft_path, PATH_MAX, "drafts/%s/%s.draft", od_control_get()->user_name, filename);
|
||||
snprintf(draft_path, PATH_MAX, DRAFT_PATH "drafts/%s/%s.draft", od_control_get()->user_name, filename);
|
||||
|
||||
if (stat(draft_path, &s) != 0) {
|
||||
return 1;
|
||||
@@ -290,7 +297,7 @@ char *message_editor() {
|
||||
while (!done) {
|
||||
od_clr_scr();
|
||||
od_set_cursor(1, 1);
|
||||
od_send_file("magiedit.ans");
|
||||
od_send_file(ANSI_PATH "magiedit.ans");
|
||||
od_set_color(D_GREY, D_BLACK);
|
||||
od_set_cursor(2, 13);
|
||||
od_printf("%-26.26s", msgto);
|
||||
@@ -467,7 +474,7 @@ char *message_editor() {
|
||||
// restore screen
|
||||
od_clr_scr();
|
||||
od_set_cursor(1, 1);
|
||||
od_send_file("magiedit.ans");
|
||||
od_send_file(ANSI_PATH "magiedit.ans");
|
||||
od_set_color(D_GREY, D_BLACK);
|
||||
od_set_cursor(2, 13);
|
||||
od_printf("%-26.26s", msgto);
|
||||
@@ -535,7 +542,7 @@ char *message_editor() {
|
||||
// restore screen
|
||||
od_clr_scr();
|
||||
od_set_cursor(1, 1);
|
||||
od_send_file("magiedit.ans");
|
||||
od_send_file(ANSI_PATH "magiedit.ans");
|
||||
od_set_color(D_GREY, D_BLACK);
|
||||
od_set_cursor(2, 13);
|
||||
od_printf("%-26.26s", msgto);
|
||||
@@ -846,7 +853,7 @@ char *message_editor() {
|
||||
// Quote
|
||||
od_clr_scr();
|
||||
od_set_cursor(1, 1);
|
||||
od_send_file("magiquote.ans");
|
||||
od_send_file(ANSI_PATH "magiquote.ans");
|
||||
od_set_color(D_GREY, D_BLACK);
|
||||
od_set_cursor(2, 13);
|
||||
od_printf("%-26.26s", msgto);
|
||||
@@ -1015,7 +1022,7 @@ char *message_editor() {
|
||||
// restore screen
|
||||
od_clr_scr();
|
||||
od_set_cursor(1, 1);
|
||||
od_send_file("magiedit.ans");
|
||||
od_send_file(ANSI_PATH "magiedit.ans");
|
||||
od_set_color(D_GREY, D_BLACK);
|
||||
od_set_cursor(2, 13);
|
||||
od_printf("%-26.26s", msgto);
|
||||
|
Reference in New Issue
Block a user