NEW YORK — A weak showing in home sales and a mixed batch of earnings kept stocks flipping between minor gains and losses Thursday on Wall Street. By the end of the day the major indexes managed to eke out their second day of gains this week.

A strong profit report from Procter & Gamble helped indexes start higher early, but stocks weakened in late-morning trading after a real estate group said the pace of contracts for new home sales had leveled off.

The Dow Jones industrial average gained 26.34 to close at 13,103.68. The S&P 500 rose 4.22 to 1,412.97, and the Nasdaq gained 4.42 to 2,986.12.

WASHINGTON — Companies are holding off on purchases of computers, industrial equipment and other long-lasting manufactured goods, a trend that’s slowing the U.S. economy.

A fourth straight month of lackluster corporate spending led many economists Thursday to trim their growth forecasts in the July-September quarter. The government will issue its first estimate of third-quarter growth today, the last snapshot of overall economic activity before the Nov. 6 presidential election.

The troubling report on business confidence overshadowed a drop in applications for unemployment aid.

NEW YORK — A two-year prison sentence for insider trading at the height of the 2008 economic crisis, by a man who was once one of the nation’s most respected business executives, is a fifth of the 10 years requested by the government and well below sentencing guidelines. Now, some experts are questioning whether it’s a fair punishment.

Judge Jed Rakoff described the sentence and $5 million fine given to former Goldman Sachs and Procter & Gamble board member Rajat Gupta, 63, on Wednesday as sufficient to deter others and properly punish Gupta.

NEW YORK — Apple missed Wall Street earnings expectations for the second straight quarter, as iPad sales fell short of analysts’ forecasts.

The slowdown in the growth of iPad sales was not unexpected, as the rumor mill correctly predicted that Apple would launch a smaller, cheaper iPad. It announced that device, the iPad Mini, on Tuesday.

Net income in its fiscal fourth quarter was $8.2 billion, up 24 percent from a year ago.

CHICAGO — It was a rough third quarter for United Airlines. Travelers stayed away, frustrated by technology glitches from United’s merger with Continental. And a huge accounting charge wiped out most of its profit.

United’s performance weakened by every measure important to airlines — per-passenger revenue fell 2.6 percent, and was down in every part of the world except for the Pacific. Traffic fell 1.5 percent. Yield, which measures fares paid, slipped 1.2 percent.

NEW YORK — Subscriber trends are turning south again for Sprint Nextel as it struggles to compete with Verizon Wireless.

The country’s No. 3 wireless carrier said Thursday it lost overall subscribers for the first time in 21/2 years in the third quarter, as customers gave up on the moribund Nextel network and the company didn’t sign up enough of them on the Sprint network.

It’s the first time Sprint reported results since agreeing to sell 70 percent of itself to Japan’s Softbank for $20.1 billion.

Wire reports