tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.


From: lostgallifreyan
Subject: [Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.
Date: Sun, 12 Apr 2009 16:02:25 +0100

As promised, here's a basic patch for allowing files passed to TCC to work in 
W9X. It can be easily overridden for usual case sensitive file extension 
handling, but in Windows it's up to the user to see that the file pointed to 
contains the right stuff, especially in instances of ASM coding where .s and .S 
are important. You can't specify which in the file name, but you can still do 
it in the written path, even with this patch.

Immediately below this line in tcc.c:
            /* add a new file */
I added this:
#ifdef _WIN32
            /* Set W9X DOS 8.3 upper case paths to lower case. */
            char *p;
            if (r[1] == ':' && r[2] == '\\') {
                for (p = r; *p; p++) {
                    if (*p != toupper(*p))
                        break;
                    else
                        for (p = r; *p; p++)
                            *p = tolower(*p);
                }
            }
#endif

I considered a command line switch as suggested by a couple of people in the 
earlier thread, but I think this is neater, it only operates in very limited 
circumstances. If you want to be sure it does nothing, make a forward slash 
instead of that first backslash, or a lower case letter on the path, any of 
these will stop it acting, it ONLY does something if it looks like a standard 
all caps path, so be aware that if you like all-caps long-name paths you need 
to think about that if you try this patch...

My test for the colon and backslash in Windows paths might even be redundant 
given the #ifdef_WIN32 bit, but I'm playing it safe in case Windows Mobile is 
considered as Win32, because it doesn't use a single drive letter at the start 
of a path. That backslash test is a useful tool, it allows the change to a 
forward slash to disable the patch as a command line switch might do.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]