The strict causation rule of People v. Bruner (1995) 9 Cal.4th 1178 does not apply when defendant is not seeking duplicate credits. Appellant was serving a two-year prison term for a Sonoma County case when he entered a guilty plea in a Mendocino County case and admitted violating probation in another case. By the terms of the Mendocino County plea bargain, he was resentenced to a consecutive sentence of eight months for the Sonoma County case. As a result, the sentence was completed months before the resentencing. The trial court declined to award the excess time from the date when the Sonoma County term was complete to the date of resentencing to the Mendocino County case as presentence credits, indicating that the time fell into the category of sentenced time on the Sonoma case. Modified. Pursuant to Penal Code section 2900.5, subdivision (b), any time appellant was in custody after the completion of the Sonoma County sentence should have been credited to the Mendocino County case. The Bruner rule of strict causation does not apply as appellant was not seeking duplicate credits and once the eight-month Sonoma County sentence was completed, the remaining custodial time should have been characterized as solely attributable to the controlling Mendocino case and allocated accordingly.