-/*
- * Copyright (C) 1995-2005, Index Data ApS
- * All rights reserved.
- *
- * $Id: readconf.c,v 1.6 2005-06-25 15:46:04 adam Exp $
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2013 Index Data
+ * See the file LICENSE for details.
*/
/**
#endif
#include <stdio.h>
-#include <ctype.h>
#include <yaz/log.h>
#include <yaz/readconf.h>
{
char *p;
int argc;
-
+
while ((p = fgets(line, len, f)))
{
(*lineno)++;
}
if (!p)
return 0;
-
- for (argc = 0; *p ; argc++)
+
+ for (argc = 0; *p && argc < num ; argc++)
{
if (*p == '#') /* trailing comment */
break;
char line[512], *m_argv[50];
int m_argc;
int lineno = 0;
-
+
if (!(f = fopen(name, "r")))
{
yaz_log(YLOG_WARN|YLOG_ERRNO, "readconf: %s", name);
for (;;)
{
int res;
-
+
if (!(m_argc = readconf_line(f, &lineno, line, 512, m_argv, 50)))
{
fclose(f);
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab