filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./files/%s/%s",
- CC->room.QRdirname, filename);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s",
+ CC->room.QRdirname, filename);
a = unlink(pathname);
if (a == 0) {
cprintf("%d File '%s' deleted.\n", CIT_OK, pathname);
return;
}
snprintf(outfile, sizeof outfile,
- "%s/network/spoolin/nsf.%04lx.%04x",
- CTDLDIR, (long)getpid(), ++seq);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/nsf.%04lx.%04x",
+ (long)getpid(), ++seq);
ofp = fopen(outfile, "a");
if (ofp == NULL) {
cprintf("%d internal error\n", ERROR + INTERNAL_ERROR);
fclose(ofp);
snprintf(buf, sizeof buf,
- "cd ./files/%s; uuencode %s <%s 2>/dev/null >>%s",
- CC->room.QRdirname, filename, filename, outfile);
+ "cd "
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ /* FIXME: detect uuencode while installation? or inline */
+ "/files/%s; uuencode %s <%s 2>/dev/null >>%s",
+ CC->room.QRdirname, filename, filename, outfile);
system(buf);
ofp = fopen(outfile, "a");
}
snprintf(pathname, sizeof pathname,
- "./files/%s/%s", CC->room.QRdirname, filename);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s", CC->room.QRdirname, filename);
CC->download_fp = fopen(pathname, "r");
if (CC->download_fp == NULL) {
ERROR + NO_SUCH_USER);
return;
}
- snprintf(pathname, sizeof pathname, "./userpics/%ld.gif",
- usbuf.usernum);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/userpics/%ld.gif",
+ usbuf.usernum);
} else if (!strcasecmp(filename, "_floorpic_")) {
which_floor = extract_int(cmdbuf, 1);
snprintf(pathname, sizeof pathname,
- "./images/floor.%d.gif", which_floor);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/floor.%d.gif", which_floor);
} else if (!strcasecmp(filename, "_roompic_")) {
assoc_file_name(pathname, sizeof pathname, &CC->room, "images");
} else {
filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./images/%s.gif",
- filename);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/%s.gif",
+ filename);
}
CC->download_fp = fopen(pathname, "rb");
CC->upl_file[a] = '_';
}
}
- snprintf(CC->upl_path, sizeof CC->upl_path, "./files/%s/%s",
- CC->room.QRdirname, CC->upl_file);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/%s",
+ CC->room.QRdirname, CC->upl_file);
snprintf(CC->upl_filedir, sizeof CC->upl_filedir,
- "./files/%s/filedir", CC->room.QRdirname);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/files/%s/filedir", CC->room.QRdirname);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {
}
if (CC->user.axlevel >= 6) {
- snprintf(CC->upl_path, sizeof CC->upl_path, "./images/%s",
- basenm);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/%s",
+ basenm);
}
if (!strcasecmp(basenm, "_userpic_")) {
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./userpics/%ld.gif", CC->user.usernum);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/userpics/%ld.gif", CC->user.usernum);
}
if ((!strcasecmp(basenm, "_floorpic_"))
&& (CC->user.axlevel >= 6)) {
which_floor = extract_int(cmdbuf, 2);
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./images/floor.%d.gif", which_floor);
+#ifndef HAVE_DATA_DIR
+ "." /* FIXME: should here be CTDLDIR ? */
+#else
+ DATA_DIR
+#endif
+ "/images/floor.%d.gif", which_floor);
}
if ((!strcasecmp(basenm, "_roompic_")) && (is_room_aide())) {
if (CC->dl_is_net == 1) {
CC->dl_is_net = 0;
- snprintf(buf, sizeof buf, "%s/network/spoolout/%s", CTDLDIR,
- CC->net_node);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolout/%s",
+ CC->net_node);
unlink(buf);
}
return;
}
- snprintf(pathname, sizeof pathname, "%s/network/spoolout/%s",
- CTDLDIR, CC->net_node);
+ snprintf(pathname, sizeof pathname,
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolout/%s",
+ CC->net_node);
/* first open the file in append mode in order to create a
* zero-length file if it doesn't already exist
}
snprintf(CC->upl_path, sizeof CC->upl_path,
- "%s/network/spoolin/%s.%04lx.%04x",
- CTDLDIR, CC->net_node, (long)getpid(), ++seq);
+#ifndef HAVE_SPOOL_DIR
+ CTDLDIR
+#else
+ SPOOL_DIR
+#endif
+ "/network/spoolin/%s.%04lx.%04x",
+ CC->net_node, (long)getpid(), ++seq);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {