#include "stdinc.h"
#include "ircd_defs.h"
-#include "common.h"
#include "defaults.h"
#include "logger.h"
#include "s_conf.h"
void hashcomment(void);
int ieof(void);
int lineno_stack[MAX_INCLUDE_DEPTH];
-char conffile_stack[MAX_INCLUDE_DEPTH][IRCD_BUFSIZE];
-char conffilebuf[IRCD_BUFSIZE+1];
+char conffile_stack[MAX_INCLUDE_DEPTH][BUFSIZE];
+char conffilebuf[BUFSIZE+1];
char *current_file = conffilebuf;
FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH];
#define YY_INPUT(buf,result,max_size) \
if (!(result = conf_fgets(buf, max_size, conf_fbfile_in))) \
- YY_FATAL_ERROR("input in flex scanner failed");
+ YY_FATAL_ERROR("input in flex scanner failed");
%}
ws [ \t]*
{
int i,j;
yylval.string[yyleng-2] = '\0'; /* remove close
- * quote
+ * quote
*/
-
+
for (j=i=0 ;yylval.string[i] != '\0'; i++,j++)
{
if (yylval.string[i] != '\\')
else
{
i++;
- if (yylval.string[i] == '\0') /* XXX
+ if (yylval.string[i] == '\0') /* XXX
* should not
* happen
*/
loadmodule { return LOADMODULE; }
-{string} {
+{string} {
strcpy(yylval.string, yytext);
yylval.string[yyleng] = '\0';
return STRING;
void ccomment()
{
int c;
-
+
/* log(L_NOTICE, "got comment"); */
while (1)
{
if (c == '*')
{
while ((c = input()) == '*');
- if (c == '/')
+ if (c == '/')
break;
if (c == '\n') ++lineno;
}
else
*strchr(++c, '>') = 0;
- /* do stacking and co. */
+ /* do stacking and co. */
if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
conf_report_error("Includes nested too deep (max is %d)", MAX_INCLUDE_DEPTH);
else
{
FILE *tmp_fbfile_in;
-
+
tmp_fbfile_in = fopen(c, "r");
-
+
if (tmp_fbfile_in == NULL)
{
- /* if its not found in PREFIX, look in ETCPATH */
- char fnamebuf[IRCD_BUFSIZE];
+ /* if its not found in PREFIX, look in IRCD_PATH_ETC */
+ char fnamebuf[BUFSIZE];
- snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", ETCPATH, c);
+ snprintf(fnamebuf, sizeof(fnamebuf), "%s%c%s", ircd_paths[IRCD_PATH_ETC], RB_PATH_SEPARATOR, c);
tmp_fbfile_in = fopen(fnamebuf, "r");
/* wasnt found there either.. error. */