New American Standard Bible (NASB)
Genesis 39
23 The chief jailer did not supervise anything under Joseph’s charge because the Lord was with him; and whatever he did, the Lord made to prosper.
Genesis 40
1 Then it came about after these things, the cupbearer and the baker for the king of Egypt offended their lord, the king of Egypt.
2 Pharaoh was furious with his two officials, the chief cupbearer and the chief baker.
3 So he put them in confinement in the house of the captain of the bodyguard, in the jail, the same place where Joseph was imprisoned.
4 The captain of the bodyguard put Joseph in charge of them, and he took care of them; and they were in confinement for some time.
5 Then the cupbearer and the baker for the king of Egypt, who were confined in jail, both had a dream the same night, each man with his own dream and each dream with its own interpretation.
6 When Joseph came to them in the morning and observed them, behold, they were dejected.
7 He asked Pharaoh’s officials who were with him in confinement in his master’s house, "Why are your faces so sad today?"
8 Then they said to him, "We have had a dream and there is no one to interpret it." Then Joseph said to them, "Do not interpretations belong to God? Tell it to me, please."
9 So the chief cupbearer told his dream to Joseph, and said to him, "In my dream, behold, there was a vine in front of me;
10 and on the vine were three branches. And as it was budding, its blossoms came out, and its clusters produced ripe grapes.