The Herd-boy was very much delighted over his stroke of good fortune , and , hiding the magic loaf in his bag , he hurried off to the nearest village to buy himself something to eat , and then returned to his sheep .