
    Rubin Needel, petitioner.
    Suffolk.
    April 2, 1962.
    May 3, 1962.
    Present: Wilkins, C.J., Spalding, Cutter, Kirk, & Spiegel, JJ.
    
      Imprisonment. Habeas Corpus.
    
    A petition for a writ of habeas corpus by a prisoner confined in a correctional institution upon legal criminal process may present a proper case for issuance of the writ as matter of discretion under G. L. (Ter. Ed.) c. 248, § 25. [261]
    The sentence of a prisoner in a correctional institution for a certain crime was not reducible under G. L. c. 127, § 129B, inserted by St. 1960, c. 350, by a number of days spent by him prior to such sentence in confinement pursuant to a previous sentence for an unrelated crime. [261-262]
    Petition for a writ of habeas corpus, filed in the Supreme Judicial Court for the county of Suffolk on January 26, 1961.
    Upon transfer to the Superior Court, the case was heard by Spring, J.
    
      Robert A. Curry, for the petitioner.
    
      Theodore R. Stanley, Assistant Attorney General, for the respondents.
   Wilkins, C.J.

This petition, originally to the county court, was transferred to the Superior Court. See G. L. c. 213, § 1A (as amended through St. 1941, c. 180); G. L. (Ter. Ed.) c. 214, § 32. It is loosely drawn. In substance it asks that a writ of habeas corpus issue to be served on the superintendent of the Massachusetts Correctional Institution at Walpole and on the commissioner of correction as respondents. There is no compliance with G. L. (Ter. Ed.) c. 248, § 3, requiring that “If the imprisonment or restraint is by virtue of a warrant or other process, a copy thereof shall be annexed, ’ ’ with exceptions not shown to be material.

The petition contains an allegation of law that the petitioner should have been released from custody on November 28, 1960. This is denied. It contains allegations of fact, which the Attorney General concedes to be correct. On November 12, 1957, the petitioner was taken into custody for a crime committed in Suffolk County on that date, and being unable to post bond or bail he was remanded to jail in the custody of the sheriff. On February 8, 1958, he was sentenced to the Massachusetts Correctional Institution at Walpole for a term of not more than six years and not less than four years. On October 16, 1959, he was released under paroi conditions. On December 9, 1959, he was taken into custody by the State police, for a crime which was committed on August 30,1957, and for which he had been secretly indicted in Essex County on January 16, 1958. He was brought to trial, found guilty, and on February 10, 1960, was sentenced to a term of not more than six years and not less than four years, to be served concurrently with the sentence for the Suffolk County crime. The Attorney General filed an “answer,” which contained, in addition to other allegations, a denial that the petitioner is unlawfully held. See Vautier, petitioner, 340 Mass. 341, 343n. The petition was dismissed, and the petitioner appealed.

The “answer” of the Attorney General sets up that the petitioner is imprisoned upon legal criminal process, and that hence habeas corpus will not lie under G. L. (Ter. Ed.) c. 248, § 1. The petitioner concedes that he is not entitled to the writ as matter of right. Such a writ, however, may issue as matter of discretion. G. L. (Ter. Ed.) c. 248, § 25. We assume that, if the petitioner’s contentions are correct, he is entitled to an immediate discharge. Stearns, petitioner, 343 Mass. 53, 57. We consider the petition as a suitable basis for considering the merits of the main question presented on this record. See Sims’s Case, 7 Cush. 285, 291-293; Chambers’s Case, 221 Mass. 178, 180-181. The appeal is here under G. L. (Ter. Ed.) c. 231, § 96.

The petitioner’s contention is that the time he served from February 8,1958, should be accounted time in custody awaiting trial under G. L. c. 127, § 129B (inserted by St. 1960, c. 350), which reads: “The sentence of any prisoner in any correctional institution in the commonwealth, who was held in custody awaiting trial shall be reduced by the number of days spent by him in confinement prior to such sentence and while awaiting trial, unless the court in imposing such sentence had already deducted therefrom the time during which such prisoner had been confined while awaiting trial.” Compare G. L. c. 279, § 33A (as amended through St. 1961, c. 75). The short answer is that the petitioner was not held “in custody awaiting trial” nor “in confinement prior to such sentence and while awaiting trial.” He was in confinement pursuant to a sentence for an unrelated crime of which he had been convicted. The statutory purpose was not to allow deductions for time served under sentence for another crime, but was to afford relief to those not convicted and not serving any sentence but who because of inability to obtain bail, for example, were held in custody awaiting trial. In Stearns, petitioner, 343 Mass. 53, the petitioner was given credit for time spent in confinement as an insane prisoner at Bridgewater State Hospital. He had not then been convicted or sentenced for a crime.

Order dismissing petition affirmed. 
      
       Minor discrepancies in dates between the petition and the respondents’ brief need not be noticed at this time. Some of these are outside the present record.
     
      
       An amendment by St. 1961, c. 74, is immaterial.
     