This patch fixes the missing feature to escape ^ character in middle of the line (http://bugs.winehq.org/show_bug.cgi?id=18346). Also included is a simple test case. Patch is based on Jason Edmeades.