
152 Cal.App.2d 579 (1957)
In re RONALD GENE NICKELSON, on Habeas Corpus.
Crim. No. 5935. 
California Court of Appeals. Second Dist., Div. Two.  
July 16, 1957.
 W. E. Kalbfleisch for Petitioner.
 William B. McKesson, District Attorney (Los Angeles), Jere J. Sullivan and Lewis Watnick, Deputy District Attorneys, for Respondent.
 MOORE, P. J.
 Petitioner filed his petition for a writ of habeas corpus on May 6, 1957. He alleged that his imprisonment is by virtue of a sentence of December 3, 1956, in the superior court whose judgment provided as follows:
 "It is therefore ordered, adjudged and decreed that the said defendant be punished by imprisonment in the County Jail of the County of Los Angeles for the term of one year with good time allowed if earned which sentence is ordered to run concurrently with the sentence defendant is now serving in the County Jail."
 The sentence referred to in the judgment was made by the Municipal Court of the South Bay Judicial District, October 23, 1956, whereby petitioner was committed for 180 days to the Los Angeles County jail. It is alleged that such October sentence has expired and "that this petitioner is not now imprisoned or restrained by said municipal court sentence ... and petitioner is now being imprisoned and detained only by virtue of" the December judgment; that such judgment for any period of time of more than six months from December 3, 1956, is now illegal and void.
 The contention of petitioner is sound. He was convicted of a violation of Penal Code, section 487, subdivision 2, and of section 664. The former section says that grand theft is committed when property is taken from the person of another. *581 The penalty for violating that section (487) is provided in section 489 as follows: "Grand theft is punishable by imprisonment in the county jail for not more than one year or in the state prison for not more than 10 years." Concerning attempts to commit a substantive offense, section 664 provides in part: "Any person who attempts to commit any crime, but fails, or is prevented or intercepted in the perpetration thereof, is punishable, where no provision is made by law for the punishment of such attempts as follows: 1. If the offense so attempted is punishable by imprisonment in the state prison for five years, or more, or by imprisonment in a county jail, the person guilty of such attempt is punishable by imprisonment in the state prison, or in a county jail, as the case may be, for a term not exceeding one-half the longest term of imprisonment prescribed upon a conviction of the offense so attempted ... 2. If the offense so attempted is punishable by imprisonment in the state prison for any term less than five years, the person guilty of such attempt is punishable by imprisonment in the county jail for not more than one year." [1] Inasmuch as the Penal Code specifies no specific penalty for "attempted grand theft from the person," the only punishment to be legally administered under subdivision 1 of section 664 by way of jail sentence is six months, which is, "for a term not exceeding one-half the longest term of imprisonment prescribed upon a conviction of the offense so attempted." That subdivision means that the court, if it elects to sentence the defendant to state prison for an attempt, can impose no more than one- half of the maximum prescribed for the substantive offense; that the imposition of a jail sentence for an attempt must be limited to one-half of the maximum jail term which can be given for the substantive crime. Any application of subdivision 2 to a situation such at that at bar, would render subdivision 1 meaningless. The brief filed on behalf of respondent concurs in this view.
 [2] Inasmuch as the sheriff of Los Angeles County and the Board of Parole Commissioners of Los Angeles County have certified to this court that petitioner has earned more than 18 days good time (see Pen. Code,  4019, 4019.2), the six-month term for which he should have been sentenced has expired and he should not be further detained. Besides the credit earned by good behavior petitioner actually served 162 days.
 On May 14, 1957, petitioner applied for a writ of habeas *582 corpus. He was released on bail and has since then been at large.
 It is, therefore, ordered that petitioner be and he is hereby released and his bail exonerated.
 Fox, J., and Ashburn, J., concurred.
