[
https://bro-tracker.atlassian.net/browse/BIT-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16601#comment-16601
]
Justin Azoff edited comment on BIT-1192 at 5/19/14 2:01 PM:
------------------------------------------------------------
Oh, yes, I know it's wrong. I was helping someone on IRC and they made that
mistake.
The issue is how is that not a syntax error and how does it somehow set cmd to
"[cmd=echo hi]"?
was (Author: jazoff):
Oh, yes, I know it's wrong. I was helping someone on IRC and they made that
mistake.
The issue is how is that not a syntax error and how does it somehow set cmd to
"cmd=echo hi"?
> record initialization weirdness
> -------------------------------
>
> Key: BIT-1192
> URL: https://bro-tracker.atlassian.net/browse/BIT-1192
> Project: Bro Issue Tracker
> Issue Type: Problem
> Components: Bro
> Affects Versions: git/master
> Reporter: Justin Azoff
> Priority: Low
> Labels: language
>
> If you redundantly define a record as in cmd_bad:
> {code}
> event bro_init()
> {
> local strcmd = "echo hi";
> print "inline", [$cmd=strcmd];
> local cmd_ok = Exec::Command($cmd=strcmd);
> print "ok", cmd_ok;
> local cmd_bad = Exec::Command([$cmd=strcmd]);
> print "bad", cmd_bad;
> }
> {code}
> You get this:
> {code}
> inline, [cmd=echo hi]
> ok, [cmd=echo hi, stdin=, read_files=<uninitialized>, uid=BHMrHdIapni]
> bad, [cmd=[cmd=echo hi], stdin=, read_files=<uninitialized>, uid=NsfjD555BY1]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3-OD-04-019#6322)
_______________________________________________
bro-dev mailing list
[email protected]
http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev