A court may sentence any person convicted of a crime committed while that person was a prisoner as defined by § 22-11A-1, to a term of not more than twice the maximum term allowed by the statute for the commission of the same crime by a person not so confined. However, the provisions of this section do not apply if, for the same offense, the prisoner is subject to an enhanced penalty as an habitual offender.
SDCL 22-6-5.1