Streamline patterns and their bifurcations in two-dimensional incompressible fluid near simple degenerate critical points away from boundaries have been investigated by Brons and Hartnack [Phys. Fluids 11, 314 (1999)] using a normal form approach. In this study, their method is extended to a nonsimple degenerate point under certain conditions. A normal form transformation is used to simplify the differential equations of a Hamiltonian system that describes the streamlines. Bifurcations in the flow occur when parameters take certain degenerate values. When the degenerate configuration is perturbed slightly, an unfolding of the system is obtained. From this, we give a complete description of the bifurcations up to codimension two. New flow patterns are found that inflow saddles are connected by a single heteroclinic connection and an interaction of two vortices with opposite rotations appears in the flow. The theory is applied to the patterns and bifurcations found numerically in the studies of Stokes flow in a double-lid-driven rectangular cavity. (c) 2005 American Institute of Physics.