From: Catalin Marinas Date: Tue, 20 Dec 2005 13:20:36 +0000 (+0000) Subject: Fix the import command when the body is empty X-Git-Tag: v0.8~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/61dabd0e4d6a7ef2377813872235565924398e4f Fix the import command when the body is empty When the description doesn't have a body, the import command generates an exception. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/imprt.py b/stgit/commands/imprt.py index fdb91ea..6ccdcc9 100644 --- a/stgit/commands/imprt.py +++ b/stgit/commands/imprt.py @@ -78,13 +78,11 @@ def __parse_description(descr): if not descr_lines: raise CmdException, "Empty patch description" - pos = -1 lasthdr = 0 end = len(descr_lines) # Parse the patch header - while pos < end: - pos += 1 + for pos in range(0, end): if not descr_lines[pos]: continue # check for a "From|Author:" line