소스 검색

[python] don't add newlines to an empty buffer

Dan Korostelev 10 년 전
부모
커밋
68298d236d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      genpy.ml

+ 1 - 1
genpy.ml

@@ -1772,7 +1772,7 @@ module Generator = struct
 		end)
 
 	let newline ctx =
-		spr ctx "\n"
+		if not (Buffer.length ctx.buf = 0) then spr ctx "\n"
 
 
 	(* Generating functions *)