MCPcopy Create free account
hub / github.com/dillo-browser/dillo / dGetcwd

Function dGetcwd

dlib/dlib.c:888–901  ·  view source on GitHub ↗

* Return the current working directory in a new string */

Source from the content-addressed store, hash-verified

886 * Return the current working directory in a new string
887 */
888char *dGetcwd (void)
889{
890 size_t size = 128;
891
892 while (1) {
893 char *buffer = dNew(char, size);
894 if (getcwd (buffer, size) == buffer)
895 return buffer;
896 dFree (buffer);
897 if (errno != ERANGE)
898 return 0;
899 size *= 2;
900 }
901}
902
903/**
904 * Return the home directory in a static string (don't free)

Callers 1

initMethod · 0.85

Calls 1

dFreeFunction · 0.85

Tested by

no test coverage detected