MCPcopy Create free account
hub / github.com/antonmedv/gitmal / parseQuotedName

Function parseQuotedName

pkg/gitdiff/file_header.go:438–452  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

436}
437
438func parseQuotedName(s string) (name string, n int, err error) {
439 for n = 1; n < len(s); n++ {
440 if s[n] == '"' && s[n-1] != '\\' {
441 n++
442 break
443 }
444 }
445 if n == 2 {
446 return "", 0, fmt.Errorf("missing name")
447 }
448 if name, err = strconv.Unquote(s[:n]); err != nil {
449 return "", 0, err
450 }
451 return name, n, err
452}
453
454func parseUnquotedName(s string, term byte) (name string, n int, err error) {
455 for n = 0; n < len(s); n++ {

Callers 2

parseGitHeaderNameFunction · 0.85
parseNameFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected