over and a right to the custody of his child during infancy, except that in the case of a daughter the right determined on her marriage under age. The right to custody might be enforced by habeas corpus, or by petition, and was absolute even as against the mother, except where the father forfeited it by his own act or conduct.
In the absence of good reason to the contrary the father had the right to determine in what religion his infant child should be brought up, and he could not effectually deprive himself beforehand of that right by an agreement to the contrary either before or in consideration of marriage or otherwise. The right continued until the child attained full age. If, however, the father waived his right by allowing the child to be brought up in a different religion he might be precluded from afterwards asserting it. The right might be lost by immorality on the part of the father or by the expression of opinions, which were immoral or irreligious. This right continued after the death of the father in spite of the mother being of a different religion, and if the father