コンテナ map は比較演算によって key を区別している。
通常は opreator < 相当の std::less が使われる。
const char* の比較ではポインタ値の大小によって判定され、文字列の中身を見ない。
使ってる環境では同じ内容のリテラル文字列は共有される(同じ領域が使われる)ようなので、
たまたま同じポインタ値が使われてうまくいっているように見える。

解決方法としては、

1. std::less を const char* で特殊化する。
  namespace std {
  template <> struct less<const char*> : binary_function<const char*,const char*,bool> {
    bool operator()(const char* x, const char* y) const { return strcmp(x, y) < 0; }
  };
  }
2. 比較関数オブジェクトを指定した map を使う。
  struct MyLess : binary_function<const char*,const char*,bool> {
    bool operator()(const char* x, const char* y) const { return strcmp(x, y) < 0; }
  };
  std::map<const char*, int, MyLess> index;
3. const char* の代わりに std::string を使う。
  std::map<std::string, int> index;

お勧めは 3 > 2 > 1 の順。