From 84ee76f5646ac2a47351d6d1c0e1b66d14a0b601 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 27 Sep 2006 08:07:45 +0000 Subject: [PATCH] Allowed comments and empty lines in startup files --- cdrskin/README | 12 ++++++++---- cdrskin/cdrskin.c | 2 ++ cdrskin/cdrskin_timestamp.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cdrskin/README b/cdrskin/README index a53ae5e..b7eef61 100644 --- a/cdrskin/README +++ b/cdrskin/README @@ -317,12 +317,16 @@ arguments from the following three files: /etc/opt/cdrskin/rc $HOME/.cdrskinrc The files are read in the sequence given above. -Each readable line is treated as one single argument. No extra blanks, -no comments, no empty lines are permitted. +Each readable line is treated as one single argument. No extra blanks. +A first character '#' marks a comment, empty lines are ignored. Example content of a startup file: -dev=1,1,0 -dev_translation=+1,0,0+1,1,0 +# This is the default device +dev=0,1,0 +# To accomodate to eventual remnant cdrskin-0.2.2 addresses +dev_translation=+1,0,0+0,1,0 + +# Some more options --fifo_start_empty fs=16m diff --git a/cdrskin/cdrskin.c b/cdrskin/cdrskin.c index d3a4e17..9350353 100644 --- a/cdrskin/cdrskin.c +++ b/cdrskin/cdrskin.c @@ -471,6 +471,8 @@ int Sfile_multi_read_argv(char *progname, char **filenames, int filename_count, while(Sfile_fgets(buf,sizeof(buf)-1,fp)!=NULL) { line_no++; l= strlen(buf); + if(l==0 || buf[0]=='#') + continue; if(pass==0){ if(l>maxl) maxl= l; diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index ab9503b..95c047a 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2006.09.27.074910" +#define Cdrskin_timestamP "2006.09.27.080826"