[Samba] %L substitution...

Glen Gibb grg at ridley.unimelb.edu.au
Sun Sep 8 12:20:01 GMT 2002

Quick question for the Samba team,

Just wondering if there is a reason that a %L substitution changes the
WHOLE string after the substitution to lowercase (in standard_sub_basic)?

This was causing me a big headache as I was using a %G later in the
string, and this was being translated into a %g...

Here's the relevant section of code from lib/substitute.c:

                case 'L' :
                        if (*local_machine)
                                string_sub(p,"%L", local_machine,l);
                        else {
                                char *ns = p;

                                string_sub(p,"%L", global_myname,l);
                                while (*ns)
                                        if (isupper(*ns))
                                                *ns = tolower(*ns);

Glen Gibb

More information about the samba mailing list