
31 Cal.App.2d 166 (1939)
In the Matter of the Application of Abbott
v.
Bernay, in Behalf of GENEVA WRIGHT, for a Writ of Habeas Corpus.
Crim. No. 3190. 
California Court of Appeals. Second Appellate District, Division One.  
February 21, 1939.
 B. Warren Vinetz for Petitioner.
 Earl Warren, Attorney-General, and Paul D. McCormick, Deputy Attorney-General, for Respondent.
 The Court.
 This is a petition for a writ of habeas corpus to procure the release of Geneva Wright, who is confined in the state hospital at Camarillo, California, as an inebriate, pursuant to a commitment issued out of the Superior Court of the State of California, in and for the Country of Riverside. At the hearing upon the writ it was shown that upon the 17th day of November, 1938, an affidavit of intemperance was filed in the aforesaid superior court, pursuant to which a warrant of apprehension was issued and served upon said Geneva Wright, who was brought before said court on November 22, 1938. A transcript of the proceedings had before the superior court was introduced into evidence, indicating that the following proceedings were had:
 "The Court: An affidavit has also been filed in the Superior Court of Riverside County, on the part of A. L. Wright, your father, alleging you to be a person addicted to the intemperate use of stimulants. The affidavit alleges that for the last ninety days Geneva Wright has been using alcoholic stimulants to excess, and when under the influence of same, abuses nurses and affiant verbally, and has hallucinations and delusions of persecution. Do you desire to testify in your own behalf?"
 "Geneva Wright: Why, I would like to have an attorney on that, and a jury trial."
 "The Court: In regard to an affidavit for excessive use of stimulants, there is no attorney, and there is no jury trial provided."
 "Geneva Wright: I thought probably that was the way it was."
 "The Court: I will ask that the witnesses be sworn. Probably the doctors better be sworn again. ..."
 Whereupon the court proceeded to take testimony, following which the commitment to the state hospital at Camarillo was issued, pursuant to which Geneva Wright was delivered into the custody of the proper authorities of said hospital, where she is now held and confined. *168
 Section 5402 of the Welfare and Institutions Code provides in substance that any person brought before the court as an inebriate shall be informed of the charge against him or her, and also informed of his or her rights to make a defense to such charge and to produce witnesses in relation thereto. It is further required that the judge shall by order fix such time and place for the hearing and examination in open court as will give a reasonable opportunity for the production and examination of witnesses.
 [1] In the instant case, it is at once apparent from the transcript of the proceedings had, which indicate a forthwith hearing before the court at the time the alleged inebriate was brought before it, that the provisions of the aforesaid section were not complied with, either with reference to giving her information with respect to her rights to make a defense to such charge and to produce witnesses in relation thereto, or to giving her what the code section denominates "a reasonable opportunity" for the production and examination of witnesses.
 Having been denied her legal rights pursuant to the code provision, it is ordered that the said Geneva Wright be discharged from the custody of the state hospital at Camarillo.
