Mmm... But can "get_user_name" return something that isn't in /etc/passwd?

Anyway, testing for NULL is a good idea.

El 9/5/22 a las 1:18, Barak A. Pearlmutter escribió:
I don't understand this code in that patch:

+                               while (true) {
+                                       unowned Posix.Passwd passwd =
Posix.getpwent();
+                                       if (passwd.pw_name ==
GLib.Environment.get_user_name()) {
+                                               found = true;
+                                               cmd += passwd.pw_shell;
+                                               break;
+                                       }
+                               }

Will that loop forever if get_user_name returns something that doesn't
have an entry in /etc/passwd?

Reply via email to