platform-independent getline