
145 Cal.App.2d 607 (1956)
McMAHAN'S OF LONG BEACH (a Corporation), Appellant,
v.
McMAHAN SERVICE CORPORATION (a Corporation), Respondent.
Civ. No. 21846. 
California Court of Appeals. Second Dist., Div. Two.  
Nov. 2, 1956.
 Clock, Waestman & Clock and E. W. Sheridan for Appellant.
 Stanley M. Arndt and John F. McCarthy for Respondent.
 FOX, J.
 In July, 1952, plaintiff brought this action to enjoin defendants from using plaintiff's trade name, or any simulation thereof, and for damages. The trial court issued a temporary injunction. An appeal was taken but it was later dismissed.
 The case not having been brought to trial, the defendants, in March, 1955, moved to dismiss the action for lack of prosecution. Neither the notice of motion nor the affidavit made any reference to costs. The motion was granted on March 23d without an appearance in opposition. The minute order, which was entered on March 25th, did not expressly award costs to defendants. A formal judgment of dismissal, dated March 24th, contained a provision in longhand that defendants have judgment for their costs. This appears to have been written in under the direction of the trial judge. The judgment and defendants' memorandum of costs were filed on March 25th.
 On April 20, 1955, the trial court, on its own motion, made a minute order amending the March 23, 1955, minute order nunc pro tunc by adding thereto the following: "Defendants are given judgment for their costs ..."
 In January, 1956, plaintiff noticed a motion  [fn. 1] to strike the minute order of April 20, 1955, on the ground that it was "invalid and void on its face and was in excess of the jurisdiction *609 of the court." This motion was denied on February 2d. It is from this order that plaintiff appeals.  [fn. 2]
 It is plaintiff's position that its suit was in equity; that therefore the award of costs was discretionary under section 1032, subdivision (c), Code of Civil Procedure;  [fn. 3] that since defendants did not demand costs either in their notice of motion to dismiss or in their supporting affidavit, the court had no authority to award defendants their costs; and that the court had no jurisdiction to amend its order of March 23, 1955, by an ex parte order on April 20th.
 Defendant, McMahan Service Corporation, argues that it was entitled to its costs as "of course" under the express language of section 1032, subdivision (b), Code of Civil Procedure; that the failure to expressly provide therefor in the order of March 23d was a clerical error and that the court had jurisdiction, sua sponte, to correct it.
 We have concluded that the position of the defendant is sound and that the order must be affirmed.
 Section 1032, Code of Civil Procedure, provides that "In the superior court, except as otherwise expressly provided, costs are allowed of course: ... (b) To the defendant upon a judgment in his favor in special proceedings and in the actions mentioned in subdivision (a) of this section, or as to whom the action is dismissed." (Emphasis added.)
 [1] Thus we have express statutory authority for the award of costs to a defendant upon the dismissal of the action. *610 No qualifications or conditions are imposed. He is entitled to his costs as a matter of right. It therefore follows that upon the dismissal of this action defendant was entitled to its costs as "of course," i. e., as a matter of right under the above code section. On this point 13 California Jurisprudence 2d, section 17, page 237, says: "A successful defendant who recovers a judgment in his favor in the superior court is entitled to recover his costs as a matter of course ... (3) where the action is dismissed as to the defendant." In 16 California Jurisprudence 2d, section 3, page 147, it is stated that "... when the defendant's motion to dismiss is granted, the defendant is entitled to recover his necessary costs ..." Consequently it was not necessary for defendant to expressly ask for costs in its notice of motion to dismiss or for the court to expressly award costs in the order of dismissal. [2] The omission, therefore, of the award of costs was clearly an inadvertence or clerical error and the ex parte order of April 20th was merely to correct the same and clarify the record (see Estate of Goldberg, 10 Cal.2d 709, 715-716 [76 P.2d 508]; Scribner v. Bertmann, 129 Cal.App.2d 204, 210-212 [276 P.2d 697]; Freeman on Judgments, vol. 1 (5th ed.), p. 302), and it in nowise constituted a discretionary judicial act initially awarding costs to defendants.
 The judge undoubtedly considered that the order of dismissal carried with it costs for defendants because when a formal judgment of dismissal  [fn. 4] was presented for his signature a day or so later he directed the court clerk to add in longhand that defendants were awarded their costs. So, when the trial judge discovered that the order of dismissal did not expressly award costs allowed as "of course" to defendants by statute he correctly concluded such an omission was an inadvertent error and proceeded to rectify such inadvertence by the nunc pro tunc order of April 20th. (Harman v. Cabaniss, 207 Cal. 60 [276 P. 569]; Scribner v. Bertmann, supra, p. 211. See Coffee v. Johnson, 24 N.Y.S.2d 588, 589.)
 [3] Plaintiff argues that the italicized language quoted above from subdivision (b) of section 1032 authorizes costs as "of course" to a defendant only upon dismissal as to him in one of the classes of cases mentioned in subdivision *611 (a) of that section. Obviously the language is not so limited. The italicized language was added in 1933. (Stats. 1933, ch. 744,  191, p. 1901.) Prior to the time when this language was incorporated into the statute, a defendant as to whom an action of the class mentioned in subdivision (a) was dismissed was entitled to his costs as "of course." (Spinks v. Superior Court, 26 Cal.App. 793 [148 P. 798]; Spreckels v. Spreckels, 172 Cal. 789 [158 P. 543].) This naturally follows because a dismissal of an action with prejudice is in fact a judgment in defendant's favor, carrying with it the right to recover costs. (Fisher v. Eckert, 94 Cal.App.2d 890, 894 [212 P.2d 64].)
 Thus the state of the law prior to 1933 was precisely that which plaintiff now urges upon us. By the addition in 1933  [fn. 5] of what would otherwise be unnecessary and superfluous language, it is reasonable to presume that the Legislature intended to enlarge the right to an award of costs to a defendant upon dismissal of the action because there is no good reason why such a defendant should not be entitled to his costs. This is sound policy and conforms to simple justice as between the parties. So, to effectuate this, the Legislature has established an additional category in which costs are awarded as a matter of right upon dismissal without regard to whether the action is legal or equitable. (Tonini v. Ericcsen, 218 Cal. 39, 41 [21 P.2d 565].)
 It is apparent from the foregoing that subdivision (c) of section 1032 is not here applicable since dismissals are specifically provided for and governed by subdivision (b) of said section. Merlino v. Fresno Macaroni Mfg. Co., 74 Cal.App.2d 120 [168 P.2d 182], relied on by plaintiff, lends no support for its position. That case does not deal with the instant problem nor does it remotely bear upon it.
 The order of February 2, 1956, (designated "judgment" in the notice of appeal) is affirmed.
 Moore, P. J., and Ashburn, J., concurred.
 "In the superior court, except as otherwise expressly provided, costs are allowed of course:"
 "(a) To plaintiff upon a judgment in his favor: in an action for the recovery of real property; in an action to recover the possession of personal property; in an action for the recovery of money or damages; in a special proceeding; in an action which involves the title or possession of real estate or the legality of a tax, impost, assessment, toll, or municipal fine."
 "(b) To the defendant upon a judgment in his favor in special proceedings and in the actions mentioned in subdivision (a) of this section, or as to whom the action is dismissed. When there are several defendants in an action mentioned in subdivision (a) of this section, not united in interest, and making separate defenses by separate answers, and plaintiff fails to recover judgment against all, the court must award costs to such of the defendants as have judgment in their favor. [Italics added.]"
 "(c) In other actions than those mentioned in this section, costs may be allowed or not, and, if allowed, may be apportioned between the parties, on the same or adverse sides, in the discretion of the court."
NOTES
[fn. 1]  1. Although Russell C. Black was also a defendant, the notice of motion was addressed to defendant McMahan Service Corporation and its attorneys only. Black is therefore not involved in this appeal.
[fn. 2]  2. In view of the conclusion we have reached, it is unnecessary to determine whether the order of April 20, 1955, is appealable.
[fn. 3]  3. The material portions of section 1032, Code of Civil Procedure, read:
[fn. 4]  4. By the provisions of section 581(d), Code of Civil Procedure, the order of dismissal by the court upon its entry in the minutes constituted an effective judgment. The subsequent formal judgment was but a memorial thereof. (E. Clemens Horst Co. v. Federal Mut. etc. Co., 22 Cal.App.2d 548, 550 [71 P.2d 599]; Darlington v. Butler, 3 Cal.App. 448, 452 [86 P. 194].)
[fn. 5]  5. In that year sections 1022, 1024 and 1026, Code of Civil Procedure, among others, were consolidated into the present section 1032, Code of Civil Procedure.
