--- dwb-2013.03.30/src/dwb.c 2013-03-30 15:03:46.000000000 +0100 +++ dwb.c 2014-01-23 22:13:33.100958249 +0100 @@ -4315,9 +4315,19 @@ static inline void dwb_check_create(const char *filename) { + #define SENGINE_STR "searchengines" + #define DDG_SEARCH_LINE "ddg https://duckduckgo.com/?q=?kj=g&t=salix&q=_dwb_search_submit_\n" + char *fname = strstr(filename, SENGINE_STR); + char buff[256]; + if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { int fd = open(filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd != -1 && fname != NULL && strncmp(fname, SENGINE_STR, strlen(fname)) == 0 + && read(fd, buff, 255) == 0) + { + write(fd, DDG_SEARCH_LINE, strlen(DDG_SEARCH_LINE) + 1); + } close(fd); } }