mhop / fhem-mirror

Branch 'master' is an unofficial read-only-mirror of https://svn.fhem.de/fhem/trunk which is updated once a day. (branch sf_old a mirror of the old repo: svn://svn.code.sf.net/p/fhem/code/trunk)
106 stars 127 forks source link

holiday allows space separator only, enhacement request: use "\s+" instead of " " for split #21

Open hjgode opened 7 years ago

hjgode commented 7 years ago

I had an issue with my holiday file and was able to find the root source: I had a tab used instead a blank to separate type and date. Therefor the split in line 75 of 95_holiday.pm did not find a date entry. Example: 1\t05-22 gelb

instead of

1 05-22 gelb

will not be found, as the split on " +" does work.

I suggest to change line 75 to:

  my @args = split("\s+", $l, 3); # use white space identifier instead of blank only: split(" +", $1, 3);

The issue in the file can not be found easily, as most editors do not show the tab different from a blank.

hjgode commented 7 years ago

I had to change the split line into .... = split(/\s+/, $1,3); as using double quotes stopped working for unknown reason