[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#252585: Xsession.options parsing fragile



Hello Marc,

It's been 3 more years and the issue is still there...

But the parsing does not (or no longer) use grep so your proposed regex
will not fit...

For information the parsing is done by the following script:
# read OPTIONFILE
OPTIONS=$(cat "$OPTIONFILE") || true

has_option() {
  if [ "${OPTIONS#*
$1}" != "$OPTIONS" ]; then
    return 0
  else
    return 1
  fi
}

So one can add a new line just after $1 and before the closing bracket }
to match exact option and remove the conflicting prefix but that would
mean the rest of the line is no longer ignored (I don't know maybe some
people were adding comments to the end of the line).
And also it doesn't allow for neither leading or ending spaces.

Maybe a good solution would be to document in Xsession(5) in the
customizing section that option name should not contain any other option
name as prefix.

What do you think ?

-- 
Julien Viard de Galbert                        <julien@vdg.blogsite.org>
http://silicone.homelinux.org/           <julien@silicone.homelinux.org>



Reply to: