nmh-workers
[Top] [All Lists]

Anybody mind if I remove this piece of strange code?

2003-10-20 11:30:05
There's a piece of code in addir (uip/folder.c) that seems well intended but
causes problems.  It's the stuff under the "short cut" comment below.

        static void
        addir (char *name)
        {
            int nlink;
            char *base, *cp;
            struct stat st;
            struct dirent *dp;
            DIR * dd;

            cp = name + strlen (name);
            *cp++ = '/';
            *cp = '\0';

            /*
             * A hack to skip over a leading
             * "./" in folder names.
             */
            base = strcmp (name, "./") ? name : name + 2;

           /* short-cut to see if directory has any sub-directories */
            if (stat (name, &st) != -1 && st.st_nlink == 2)
                return;

            ...

I'm busy moving stuff around on my computers, and I made a Mail directory on
a new machine and linked all of the folders to the old machine.  Problem is,
the folder command doesn't work because there are no subdirectories in the
mail directory, even though there are links to them.  This code is probably
left over from before symbolic links were invented!

Anyone have a problem if I remove this test?

Jon

<Prev in Thread] Current Thread [Next in Thread>