Is there any movie based on the "I Am Legend" novel by Richard Matheson that shares the same ending to the book?
I only know two, but could be more: (1) Will Smith's "I Am Legend", (2) and Vincent Price's "The Last Man On Earth" . Both present the spectator with a different/alternative ending, far from what happen in the actual book.
SPOILER ALERT - How the book ends (thanks to Wad Cheber)
The book ends with Neville (a bitter, despicable alcoholic) discovering that he has been ruthlessly murdering thousands of innocent sick people (including his wife and child), many of whom were trying to rebuild society. They arrest him and sentence him to death, but he commits suicide in his cell. His last thought is that in this new society, he will be remembered as the personification of evil, a story used to scare children. He will become a legendary figure representing all that is evil - hence the title "I Am Legend".