You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG - (Windows) Feeding aas_log a message with a full path can give unreadable output #276
On windows, paths can have a \ in them. However, aas_log uses printf functions during logging, with the input message as format specifier. In printf functions, a \ is the start of a special operator. Thus each time such a character is encountered, the printf function will either say that it does not recognize the operator, or print a message with unexpected formatting (i.e. it may have returned to the start of the line halfway into the message)
To prevent this, when a path is part of the message to aas_log, any \ characters should be escaped by doubling them, before sending the message to aas_log.
The replacement cannot be done inside aas_log on the incoming message, as some messages do use valid print formatting, e.g. they use \n to have a newline in the message.
% When used in aas_log messages, escape backward slashes from
% windows paths.
logsafe_path = strrep(unsafe_path, '\', '\\');
msg = sprintf('Done: %s for %s \n', description, logsafe_path);
aas_log(aap, false, msg)
Activity
AljenU commentedon Nov 8, 2021
A common case where this happens, is when one of the first two outputs of aas_doneflag_getpath_bydomain is used in a aas_log message.
Fix log messages containing a path
Fix log messages containing a path
Fix log messages containing a path