According to Bernard Cornwell, author of the 'Sharpe' series, he only finished half the novel in time for filming, so the beginning half of the book is followed quite accurately, but the endings are different.
The book upon which this is based is dedicated to Sean Bean, the actor who plays Richard Sharpe.