Starbucks delivered a jolt to Wall Street today, but alas it wasn't caffeine.

Instead the caliph of the coffee chains warned that earnings next year will be at least 10 percent lower than previously forecast.

The Starbucks announcement came as Wall Street was clinging by the fingernails to tiny gains--all it could hold on to when the market went into a slide following deadly bombing attacks in Jordan.

The markets were on their way to another good day before reports of the bombings hit the wires, immediately triggering some panic selling that wiped out most of the gains.

The Dow Jones industrial average finished the trading day up 6 points at 10,546.21. The Standard & Poor's 500 stock index closed up 2 points to 1,220.66. The Nasdaq Stock Market composite index was up 4 points to 2,175.81.

Today's reversal showed that even though Wall Street is fired up for an end-of-the-year rally, outside events can still knock the market off course.

Consumer goods companies and retailers helped lift the market. One of the big winners was Federated Department stores, which just completed its acquisition of May Department Stores, the parent of Hecht's and Lord & Taylor. Another was Whole Foods, which boosted its dividend and split its stock.

But shares of General Motors fell to a 13-year low today as analysts put GM's business under the microscope and found more flaws that could hurt future profits.