SUMMARY Kcron misinterprets some crontab comments as jobs, ignoring the hash character. STEPS TO REPRODUCE 1. Close Kcron/System Settings if it's already running. 2. Using the command line, edit your user's crontab (crontab -e). 3. Write this comment at the end of the file: # - - - * randomtext 4. Close the editor, wait for your crontab to be updated and open Kcron. OBSERVED RESULT In Kcron, the comment appears as a disabled job, with "- - - *" as scheduling and "randomtext" as command. It completely ignores the # hash character. EXPECTED RESULT As any comment, it should never be shown as a job, but ignored or used as "description" if it's right above a given job. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Gentoo (profile default/linux/amd64/17.1/desktop/plasma stable, kernel 5.4.92) KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.77.0 Qt Version: 5.15.2 Kcron version (as shown in package manager): 20.08.3:5 ADDITIONAL INFORMATION
A possibly relevant merge request was started @ https://invent.kde.org/system/kcron/-/merge_requests/22
Git commit 9abf45fa8bd27a22739a721641e5b8dd679a9bdc by Albert Astals Cid, on behalf of Cássio Sousa. Committed on 24/12/2023 at 12:17. Pushed by aacid into branch 'master'. Improvements in the handling of crontab comments Improvements in the handling of crontab comments include appending all commented lines above a cron expression and discarding previous ones if there is an enter. Works situations ```sh #- - - * randomtext abc #5 * * * * /home/ubuntu/teste.sh #- - - * randomtext abc 5 * * * * /home/ubuntu/teste.sh #- - - * randomtext abc #5 * * * * /home/ubuntu/teste.sh ``` ```sh #- - - * randomtext abc #5 * * * * /home/ubuntu/teste.sh #- - - * randomtext abc 5 * * * * /home/ubuntu/teste.sh ``` ```sh # another comment #- - - * randomtext abc 5 * * * * /home/ubuntu/teste.sh ``` Before: | header | header | | ------ | ------ | |  |  | After | header | header | | ------ | ------ | |  |  | Another example ```sh #- - - * randomtext abc #5 * * * * /home/ubuntu/teste.sh #- - - * randomtext abc 5 * * * * /home/ubuntu/teste.sh #teste abc #\ * * * /home/ubuntu/kde/src/kcron/Messages.sh #testes comentários 10 * * * * /home/ubuntu/kde/src/kcron/Messages.sh ```  M +15 -24 src/crontablib/ctcron.cpp https://invent.kde.org/system/kcron/-/commit/9abf45fa8bd27a22739a721641e5b8dd679a9bdc