~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/strconv/quote.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
                        rune, width = utf8.DecodeRuneInString(s)
25
25
                }
26
26
                if width == 1 && rune == utf8.RuneError {
27
 
                        goto printEscX
 
27
                        buf.WriteString(`\x`)
 
28
                        buf.WriteByte(lowerhex[s[0]>>4])
 
29
                        buf.WriteByte(lowerhex[s[0]&0xF])
 
30
                        continue
28
31
                }
29
32
                if rune == int(quote) || rune == '\\' { // always backslashed
30
33
                        buf.WriteByte('\\')
58
61
                default:
59
62
                        switch {
60
63
                        case rune < ' ':
61
 
                        printEscX:
62
64
                                buf.WriteString(`\x`)
63
65
                                buf.WriteByte(lowerhex[s[0]>>4])
64
66
                                buf.WriteByte(lowerhex[s[0]&0xF])