1
0
mirror of https://github.com/golang/go synced 2024-11-22 21:20:03 -07:00

bug fix: literals can be empty

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=30080
CL=30080
This commit is contained in:
Robert Griesemer 2009-06-08 19:25:26 -07:00
parent bbc2c03852
commit 9b480bb78a

View File

@ -567,7 +567,7 @@ func (s *State) eval(fexpr expr, value reflect.Value, index int) bool {
s.hasOutput = true;
// write literal segments
for _, lit := range t {
if lit[0] == '%' && len(lit) > 1 {
if len(lit) > 1 && lit[0] == '%' {
// segment contains a %-format at the beginning
if lit[1] == '%' {
// "%%" is printed as a single "%"