~ubuntu-branches/ubuntu/trusty/syslog-ng/trusty-proposed

« back to all changes in this revision

Viewing changes to src/cfg.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2010-03-28 19:47:36 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100328194736-1ob7kh1qr0fy8b9k
Tags: 3.1.0-1
* New upstream release.
* Fix path of syslog logfile (closes: #575722) and use tty10 instead of
  vc/10 to log on console.
* Provide syslog-ng in initscript (closes: #575723).

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
  self->version = 0;
214
214
  while (!feof(cfg))
215
215
    {
216
 
      gchar *pragma, *value, *colon, *eol;
 
216
      gchar *pragma, *value, *colon, *eol, *p;
217
217
      gchar line[1024];
218
218
 
219
 
      if (fgets(line, sizeof(line), cfg) == NULL || line[0] != '@')
 
219
      start_ofs = ftell(cfg);
 
220
      p = fgets(line, sizeof(line), cfg);
 
221
      (*lineno)++;
 
222
 
 
223
      if (p && (p[0] == '#' || p[0] == '\n'))
 
224
        continue;
 
225
      if (!p || line[0] != '@')
220
226
        {
 
227
          lineno--;
221
228
          fseek(cfg, start_ofs, SEEK_SET);
222
229
          return TRUE;
223
230
        }
224
 
      (*lineno)++;
225
231
      
226
 
      start_ofs += strlen(line);
227
232
      colon = strchr(line, ':');
228
233
      eol = strchr(line, '\n');
229
234
 
322
327
 
323
328
  if ((cfg = fopen(fname, "r")) != NULL)
324
329
    {
325
 
      gint lineno = 1;
 
330
      gint lineno = 0;
326
331
      
327
332
      if (!cfg_read_pragmas(self, cfg, &lineno))
328
333
        {