am 8cd9e4f3: fix bug in applying patches

Merge commit '8cd9e4f3d4eba481b411482331293c8079ab24b2' into gingerbread

* commit '8cd9e4f3d4eba481b411482331293c8079ab24b2':
  fix bug in applying patches