Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2244

@if minimum_version fails when lines contain the character: @

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.3
    • Component/s: Parsing
    • Labels:
      None
    • Platform:
      Windows, Linux

      Description

      The following bundle will not parse all chars and print the '@' to stdout. So cf-execd wil mait it:
      <pre>
      bundle common test
      {
      @if minimum_version(300.600)
      Some new function here...
      @should_pass
      bundle agent netgroup(@netgroup_list)
      more text...
      @endif
      }
      </pre>

      run it with cf-promises will produce this on the output
      <pre>
      @@
      </pre>

      The chars are not parsed due this statement in cflex.l:
      <pre>
      <if_ignore_state>[^@]

      { ParserDebug("\tL:inside macro @if, ignoring text:%s\n", yytext); }

      </pre>

      I have a fix just testing it. It's strange to parse single chars instead of a line/word when we are in ignore state. The debug is much easier when per line. I will come back on the subject tomorrow. It already caused much noise

        Attachments

          Activity

            People

            • Assignee:
              a10040 Kristian Amlie
              Reporter:
              bas Bas van der Vlies
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel