Page MenuHomeFreeBSD

Implement quote escaping. String values may now contain " if you it is preceded by \.
ClosedPublic

Authored by imp on May 10 2016, 1:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 2:33 AM
Unknown Object (File)
Sat, Nov 23, 12:29 AM
Unknown Object (File)
Oct 16 2024, 12:43 AM
Unknown Object (File)
Oct 16 2024, 12:43 AM
Unknown Object (File)
Oct 16 2024, 12:43 AM
Unknown Object (File)
Oct 16 2024, 12:42 AM
Unknown Object (File)
Oct 16 2024, 12:22 AM
Unknown Object (File)
Oct 2 2024, 4:34 AM
Subscribers
None

Details

Summary

foo="I \"like\" C++"

gives the value 'I "like" C++' to the variable 'foo'.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7737
Build 7884: arc lint + arc unit

Event Timeline

imp retitled this revision from to Implement quote escaping. String values may now contain " if you it is preceded by \..
imp updated this object.
imp edited the test plan for this revision. (Show Details)
sbin/devd/devd.cc
429

Don't you want to keep going? This stops after the first '\' I think? Maybe just do this:

while (*src) {
    if (*src == '\\')
        src++;
    else
       *dst++ = *src++;
}
*dst = '\0';

Also, 'dst' isn't initialized.

sbin/devd/devd.cc
451

This log statement is now inaccurate. I think you should log the fixed val instead of the raw val.

asomers requested changes to this revision.Jun 21 2016, 9:06 PM
asomers edited edge metadata.

Formally requesting a change for the log issue, just so it doesn't get lost.

This revision now requires changes to proceed.Jun 21 2016, 9:06 PM
imp edited edge metadata.

Fix issues raised in the review.

Updating D6286: Implement quote escaping. String values may now contain " if you

it is preceded by \.

sbin/devd/devd.cc
429

Just made it apply to ", but you're right. I don't know what I was thinking.

Something's screwed up with this review. When I try to view just your change from Sunday, it looks like it reverts the original change. But when I try to view both changes together, they look correct. What's going on?

Also, your more recent change didn't correctly fix the log message in var_list::set_variable.

This revision was automatically updated to reflect the committed changes.