*479Opinion
FRANSON, Acting P. J.Statement of the Case
This appeal presents a narrow question of first impression: whether a defendant serving a justice court sentence who is removed from jail before the expiration of the sentence and committed to the California Rehabilitation Center (CRC) pursuant to a superior court sentence on a different charge is entitled to credit for the time spent at CRC before the expiration of the justice court sentence. We answer the question in the affirmative. Two other minor credit issues are also raised.
On July 14, 1977, appellant was charged with selling heroin (Health & Saf. Code, § 11352) or in the alternative, selling a substance in lieu of a narcotic (Health & Saf. Code, § 11355). He was arrested on July 18, 1977, while serving a previous jail sentence for being under the influence of heroin imposed by the Tulare County Justice Court. Appellant pleaded not guilty to the felony charge.
Appellant was thereafter tried and convicted of selling heroin. Criminal proceedings were suspended, and he was committed to CRC, being received there on October 22, 1977. According to the probation officer’s report, appellant’s justice court sentence was due to expire on February 20, 1978.
Nearly four years later on June 2, 1981, pursuant to In re Morales (1981) 115 Cal.App.3d 456 [171 Cal.Rptr. 425],1 appellant was returned to superior court where he was sentenced in this action to the upper term of 5 years and given credit as follows: 518 days for custody at CRC, 48 days’ conduct credit and 96 presentence days for a total of 662 days of credit. Criminal proceedings were again suspended, and appellant was recommitted to CRC.
A year and a half later on October 26, 1982, due to an unrelated grand theft conviction (Tulare County Superior Court action No. 21272), criminal proceedings again were reinstated in the present action. On November 12, 1982, appellant was committed to state prison in the present action for “the term prescribed by law,” his time to run consecutive to the grand theft *480sentence which had been imposed on October 26, 1982. A total of 847 custody and conduct days were credited to appellant for his time spent awaiting sentencing. No credit was given to appellant for his time at CRC prior to the expiration of his justice court sentence.
Discussion
I
Appellant is entitled to credit for time spent at CRC prior to the expiration of his justice court sentence
The superior court had no jurisdiction to commit appellant to CRC when he was already serving an unrelated misdemeanor sentence. Once a defendant is sentenced to prison or to jail in one action a judge in a subsequent action cannot send him to CRC for evaluation before the earlier prison or jail term expires. (People v. Superior Court (Syvinski) (1970) 2 Cal.3d 527, 533 [86 Cal.Rptr. 83, 468 P.2d 211]; People v. Victor (1965) 62 Cal.2d 280, 289-297 [42 Cal.Rptr. 199, 398 P.2d 391].) The cases point out that if a CRC commitment were permitted in such a situation, either the CRC commitment would have to stand by until the defendant had served his prison or jail sentence, or else that sentence would have to be suspended; however, neither alternative is provided for by statute. A person who is already serving ¿ term of incarceration, therefore, is ineligible for treatment at CRC, there being no provision in the law to transfer such a person to the rehabilitation center. (People v. Superior Court (Syvinski), supra, 2 Cal.3d at p. 532.)
Nevertheless, appellant was committed to and received by CRC on October 22, 1977, several months before his jail term expired. Thus, we must decide what effect this improper commitment had for credit purposes on appellant’s ultimate sentence to prison.
The record before us provides ample evidence that if appellant had not been sent to CRC in October 1977, he would have been sentenced to prison. Since the superior court had no jurisdiction to commit him to CRC, we conclude it is only reasonable that appellant’s illegal CRC commitment be treated as a prison sentence for credit purposes.2
*481n
Appellant is entitled to credit for time spent in the Tulare County jail from October 26, 1982 (the date criminal proceedings were reinstated), to November 12, 1982 (the date of sentencing)
In People v. Schaaf (1984) 150 Cal.App.3d 45 [197 Cal.Rptr. 458], we held that a defendant is entitled to credit for the time he spends in jail awaiting sentence even though he is, at the same time, serving a prison sentence on an unrelated charge. The only requirement for such credit is that the restraint on the unrelated crime “not precede the restraint caused by the pending case.” (Id., at p. 47.)
Appellant was arrested in the present case on July. 18, 1977. Three months later he was committed to CRC where he remained, for the most part, until October 26, 1982. While at CRC, appellant was arrested on September 28, 1982, on an unrelated charge of grand theft. On October 26, 1982, Judge Ballantyne sentenced appellant on the grand theft charge and immediately thereafter, in the same hearing, reinstated criminal proceedings against him in the present case. Since the restraint on the grand theft charge did not precede the restraint imposed in this action, appellant is entitled to credit for his time in custody awaiting sentencing on the present charge. His sentencing on the grand theft charge did not cut off his right to such credit. (People v. Schaaf, supra, 150 Cal.App.3d 45.)
HI
Appellant is entitled to conduct credit for the various short periods of confinement in the Tulare County jail
Appellant claims he was improperly denied conduct credit3 for days spent in the Tulare County jail from April 3, 1980, to April 4, 1980; from July 15, 1980, to July 21, 1980; from October 14, 1980, to October 17, 1980, and from May 19, 1981, to May 24, 1981. He argues that “[ajbsent a reason for denial of credit, [he] is entitled to credit . . . .” We glean from the probation report that appellant’s confinement during these periods resulted from his violation of the terms and conditions of his outpatient parole from CRC. Thus, the confinement is attributable to his CRC commitment which in turn is attributable to the same conduct for which appellant was initially convicted in the present case. (See In re Atiles (1983) 33 Cal.3d 805, 811 *482[191 Cal.Rptr. 452].) He therefore is entitled to credit for time in custody prior to commencement of his sentence. (Pen. Code, § 2900.5.)
The judgment is affirmed. The matter is remanded to the trial court for recalculation of presentence credit for the total time appellant spent in custody at CRC, for the time he spent in the Tulare County jail attributable to his CRC commitment and for the time he spent in jail from the date criminal proceedings were reinstated until his sentencing in the present case. Such credit shall be awarded to appellant on his sentence in this case.
Zenovich, J., and Andreen, J., concurred.
In re Morales, supra, requires that CRC inmates committed before July 29, 1980, the effective date of the amendment to Welfare and Institutions Code section 3201 which provides that the term of commitment for those committing crimes after the effective date of the amendment is to be limited to the determinate sentence for their underlying offense, are entitled to the benefit of the amendment as a matter of equal protection; hence, they should be returned to the superior court for imposition of sentence on the underlying offense.
We recognize that the trial court could have ordered appellant’s sentence for heroin sale to run consecutive to his justice court sentence for heroin use, thereby depriving him of a right to dual credit. (Pen. Code, § 2900.5, subd. (b).) We doubt, however, that the court would have bothered to do this since there was less than four months remaining on the misdemeanor sentence. Appellant should be given the benefit of the doubt and the provisions of Penal Code section 669 should control to allow him dual credit as if the court had ordered concurrent terms. Penal Code section 669 reads in relevant part: “Upon the failure of the court so to determine how the terms of imprisonment on the second or subsequent judgment shall run, the term of imprisonment on the second or subsequent judgment shall run concurrently.”
Appellant does not distinguish between conduct and custody credit in his supplemental brief; he merely argues that he was wrongfully denied “credit.” The probation officer’s report reflects that appellant was allowed full actual time credit for these short periods of custody, so appellant’s argument must be deemed to concern conduct credit.