Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/unsetenv.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / unsetenv.c` 29 lines ยท 605 bytes Raw Blame History 1 #include "../git-compat-util.h" 2 3 int gitunsetenv(const char *name) 4 { 5 #if !defined(__MINGW32__) 6 extern char **environ; 7 #endif 8 int src, dst; 9 size_t nmln; 10 11 nmln = strlen(name); 12 13 for (src = dst = 0; environ[src]; ++src) { 14 size_t enln; 15 enln = strlen(environ[src]); 16 if (enln > nmln) { 17 /* might match, and can test for '=' safely */ 18 if (0 == strncmp (environ[src], name, nmln) 19 && '=' == environ[src][nmln]) 20 /* matches, so skip */ 21 continue; 22 } 23 environ[dst] = environ[src]; 24 ++dst; 25 } 26 environ[dst] = NULL; 27 28 return 0; 29 }