#include <mit-copyright.h>
#include <stdio.h>
#include <Xm/Xm.h>
+#include <moira.h>
#include "mmoira.h"
char *node;
{
FILE *helpfile = NULL;
- char buf[1024], key[32];
+ char buf[1024], key[32], *msg, helpbuf[10240], *filename;
+ char *realloc(), *getenv();
sprintf(key, "*%s\n", node);
- helpfile = fopen(HELPFILE, "r");
+ filename = getenv("MOIRAHELPFILE");
+ if (filename == NULL)
+ filename = HELPFILE;
+ helpfile = fopen(filename, "r");
if (helpfile == NULL) {
display_error("Sorry, help is currently unavailable.\n");
return;
fclose(helpfile);
return;
}
+ msg = NULL;
while (fgets(buf, sizeof(buf), helpfile))
if (buf[0] == '*')
break;
- else
- fprintf(stderr, buf);
+ else {
+ if (msg) {
+ if (!strcmp(buf, "\n"))
+ strcpy(buf, " \n");
+ msg = realloc(msg, strlen(msg) + strlen(buf));
+ strcat(msg, buf);
+ } else
+ msg = strsave(buf);
+ }
fclose(helpfile);
+ if (msg) {
+ PopupHelpWindow(msg);
+ free(msg);
+ }
return;
}