Page 1 of 1

Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Posted: Fri Apr 30, 2021 12:43 pm
by Mac9LnUniDU
Is the preference file "~/.sheepshaver_prefs" of SheepShaver capable of comments by recognizing comment characters such as '#' in bash, '//' in C++ or '<!-- -->' in HTML?

If it is capable of ignoring a comment lead by a comment character like '#', can the comment start in the middle of the line, or does the comment have to start at the beginning of the line?

Re: Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Posted: Fri Apr 30, 2021 1:48 pm
by Ronald P. Regensburg
I do not know for sure, but I very much doubt it.

What would you want to use commenting out for? You can delete a line if you wish. The next time you save settings in the GUI prefs editor, the line will re-appear.

Re: Is the preference file of SheepShaver capable of comments like those preceded by '#'?

Posted: Fri Apr 30, 2021 4:55 pm
by adespoton
Mac9LnUniDU wrote: Fri Apr 30, 2021 12:43 pm Is the preference file "~/.sheepshaver_prefs" of SheepShaver capable of comments by recognizing comment characters such as '#' in bash, '//' in C++ or '<!-- -->' in HTML?

If it is capable of ignoring a comment lead by a comment characters like '#', can the comment start in the middle of the line, or does the comment have to start at the beginning of the line?
I just checked through the source to refresh myself. In BII and SheepShaver, each newline is checked for a prefs argument. If a recognized one is found at the start of the line, the associated value is loaded. If an unrecognized value is found, 'WARNING: Unknown preferences keyword '%s'' is emitted and prefs loading continues to the next line.

Beyond that, there is specific code to check the first character. A # or ; at the start of the line will result in that line being ignored. Any # or ; found in the middle of a line will be part of the value provided, as the code just checks the keyword, the delimiter, and the value, which is the rest of the line, with spaces stripped, until the end of line (ignoring any newline at the end).