Merge lp:~jlmuir/epics-base/iocsh-comment-fix-3.14 into lp:~epics-core/epics-base/3.14

Proposed by J. Lewis Muir
Status: Merged
Merged at revision: 12316
Proposed branch: lp:~jlmuir/epics-base/iocsh-comment-fix-3.14
Merge into: lp:~epics-core/epics-base/3.14
Diff against target: 16 lines (+6/-0)
1 file modified
src/libCom/iocsh/iocsh.cpp (+6/-0)
To merge this branch: bzr merge lp:~jlmuir/epics-base/iocsh-comment-fix-3.14
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+88243@code.launchpad.net

Description of the change

Fixes bug where lines that become comment lines after macro expansion are not handled as comment lines.

To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote :

There's a similar bug if you indent comment lines. I'll merge your change and fix that as well.

Thanks,

- Andrew

review: Approve
Revision history for this message
J. Lewis Muir (jlmuir) wrote :

I'm aware that indented comment lines do not work (even before macro substitution). I assumed this was by design since the EPICS Application Developer's Guide says, "A '#' in the first column of a line indicates the beginning of a comment which continues to the end of the line."

Revision history for this message
Andrew Johnson (anj) wrote :

Indented comment lines that have a space after the '#' character *do* work though, they get executed as a '#' command, which just takes slightly longer to do nothing. This is using 3.14.12.1:

epics> #Hello
epics> # Hello
epics> #Hello
Command #Hello not found.
epics> # Hello
epics> epicsEnvSet C #
epics> $(C)Hello
Command #Hello not found.
epics> $(C) Hello
epics> $(C)Hello
Command #Hello not found.
epics> $(C) Hello

I would rather that we permit all indented comments than try to change or explain that behaviour.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/libCom/iocsh/iocsh.cpp'
2--- src/libCom/iocsh/iocsh.cpp 2011-04-26 20:18:30 +0000
3+++ src/libCom/iocsh/iocsh.cpp 2012-01-11 17:47:26 +0000
4@@ -568,6 +568,12 @@
5 puts(line);
6
7 /*
8+ * Ignore lines that become comment lines after macro expansion
9+ */
10+ if (*line == '#')
11+ continue;
12+
13+ /*
14 * Break line into words
15 */
16 icout = icin = 0;

Subscribers

People subscribed via source and target branches