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)
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
Unknown Object (File)
Sep 25 2024, 12:23 AM
Unknown Object (File)
Sep 24 2024, 5:33 PM
Subscribers
None

Details

Summary

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

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
428 ↗(On Diff #16095)

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
448 ↗(On Diff #16095)

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
428 ↗(On Diff #16095)

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.