Hello everybody

I've got working collision detection and "sliding" response to it. Everything is working just fine, but when there is only one wall to collide (I'm ignoring collisions with terrain yet). When there is second wall, problems begin to emerge.
Following picture demonstrates what I'm talking about.

Click image for larger version. 

Name:	exmpl_zpsa4f67209.jpg 
Views:	198 
Size:	28.4 KB 
ID:	1388

Part A is the situation, in which everything works fine, the character (circle) simply slides along it.
What I need to achieve is when we reach the corner, the character should stop, as there is nowhere to go, but instead it ignores the first wall, and moves through it.

Here's simplified code of my move function:

Code :
void ObjMobile::Move(glm::vec3 velocity)
  if (FindCollisions(velocity))
    for (Collision &c : collisions)
      velocity -= coll.Normal() * glm::dot(velocity, coll.Normal());
  position += velocity;
Collision is simply struct that contains colliding wall's normal, and collision point.

So, putting everything short: I want to prevent movement against all the walls, when there are multiple collisions. What am I missing in my code?