/[pengfork]/pengfork/src/options.c
ViewVC logotype

Diff of /pengfork/src/options.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35 by chupa, Tue Feb 11 14:54:45 2003 UTC revision 1.36 by chupa, Fri May 16 15:28:44 2003 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2002-2003  Jean-Charles Salzeber <jc@varspool.net>   * Copyright (C) 2002-2003  Jean-Charles Salzeber <chupa@penggy.org>
3   *   *
4   * This file is part of penggy.   * This file is part of penggy.
5   *   *
# Line 230  init_parameters (void) Line 230  init_parameters (void)
230           NULL, NULL,           NULL, NULL,
231           __tcpip, check_port)           __tcpip, check_port)
232  #endif /* ENABLE_TCPIP */  #endif /* ENABLE_TCPIP */
233    
234    #if ENABLE_CONTROL
235        /* CONTROL SPECIFIC */
236        , BOOL (0, NULL, "enable_control", true,
237             NULL, NULL,
238             __control, NULL),
239        BOOL (0, NULL, "enable_admin", false,
240             NULL, NULL,
241             __control, NULL),
242        STR (0, NULL, "socket_path", DEFAULT_SOCKET_PATH,
243             NULL, NULL,
244             __control, NULL),
245        BOOL (0, NULL, "connect_on_run", DEFAULT_SOCKET_PATH,
246             NULL, NULL,
247             __control, NULL),
248        BOOL (0, NULL, "connect_on_run", DEFAULT_SOCKET_PATH,
249             NULL, NULL,
250             __control, NULL),
251    #endif /* ENABLE_CONTROL */
252    };    };
253    
254  #undef STR  #undef STR
# Line 803  void Line 822  void
822  strip_comments (line)  strip_comments (line)
823       char *line;       char *line;
824  {  {
825    char *comment;    char *linedup = strdup(line);
826      char *duped = linedup;
827    comment = strchr (line, '#');    int i = 0, quote = 0, escape = 0;
828    if (comment != NULL)  
829      *comment = '\0';    for (; *linedup != '\0'; linedup++) {
830        if (escape) {
831          line[i++] = *linedup;
832          escape = 0;
833        } else if (*linedup == '\\')
834          escape = 1;
835        else if (*linedup == '#' && !quote)
836          break;
837        else if (*linedup == '"')
838          quote ^= 1;
839        else
840          line[i++] = *linedup;
841      }
842      line[i] = '\0';
843      free(duped);
844  }  }
845    
846  int  int

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26