4 ms·
fgets reads until the next newline character, or at most size-1 characters. For arbitrary inputs, a loop like that sets ret to TRUE if the given prefix (i.e. LA
by eMSF 6y ago
fgets reads until the next newline character, or at most size-1 characters. For arbitrary inputs, a loop like that sets ret to TRUE if the given prefix (i.e. LANG) is found at the beginning of any line, i.e. starting at the first column – or for longer lines, if it is found starting at the 50th column (or 99th column, etc.)
I don't know enough of the format of the .pam_environment file to tell whether that may lead to unexpected results.