Skip to content

Commit fea3f5d

Browse files
FelixIsaacclaude
andcommitted
fix: use explicit backslash character for replacement
- Use ASCII code 92 for backslash to avoid parsing issues - Ensures backslash replacement works correctly on Unix - Fixes invalid JSON with unescaped backslashes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8c3d08c commit fea3f5d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/sync/paths.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ func expandInObject(obj interface{}, claudeDir string) interface{} {
7373
// On Unix systems, convert backslashes to forward slashes in paths
7474
if !strings.Contains(claudeDir, `\`) {
7575
// This is Unix - convert Windows-style backslashes to forward slashes
76-
// But only convert path separators, not escape sequences
77-
// In JSON strings, \\ is already unescaped to \, so we just replace \
78-
expanded = strings.ReplaceAll(expanded, `\`, `/`)
76+
// Use string replacement with explicit backslash character
77+
// The JSON unmarshaler has already converted \\ to \, so we just need to convert \ to /
78+
backslash := string(rune(92)) // ASCII 92 = backslash
79+
expanded = strings.ReplaceAll(expanded, backslash, `/`)
7980
}
8081

8182
return expanded

0 commit comments

Comments
 (0)