diff options
author | Andreas Schneider <asn@samba.org> | 2010-05-10 15:05:46 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-18 15:16:55 +0200 |
commit | a3b81a908c9c866066316b01efe5bb0bc8937a86 (patch) | |
tree | 1076e097c92831a1133528a75f5a3b1d504a2717 /source3 | |
parent | 9bbf761bfe64b708144fb44b3f726c85efc58238 (diff) | |
download | samba-a3b81a908c9c866066316b01efe5bb0bc8937a86.tar.gz samba-a3b81a908c9c866066316b01efe5bb0bc8937a86.tar.bz2 samba-a3b81a908c9c866066316b01efe5bb0bc8937a86.zip |
s3-spoolss: Use better names for set_last_from_to.
Use set_driver_mapping() and get_win_driver(), get_os2_driver().
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/nt_printing.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 40a727d853..0519e29775 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -3851,39 +3851,36 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu /**************************************************************************** ***************************************************************************/ -static char *last_from; -static char *last_to; +static char *win_driver; +static char *os2_driver; -static const char *get_last_from(void) +static const char *get_win_driver(void) { - if (!last_from) { + if (win_driver == NULL) { return ""; } - return last_from; + return win_driver; } -static const char *get_last_to(void) +static const char *get_os2_driver(void) { - if (!last_to) { + if (os2_driver == NULL) { return ""; } - return last_to; + return os2_driver; } -static bool set_last_from_to(const char *from, const char *to) +static bool set_driver_mapping(const char *from, const char *to) { - char *orig_from = last_from; - char *orig_to = last_to; + SAFE_FREE(win_driver); + SAFE_FREE(os2_driver); - last_from = SMB_STRDUP(from); - last_to = SMB_STRDUP(to); + win_driver = SMB_STRDUP(from); + os2_driver = SMB_STRDUP(to); - SAFE_FREE(orig_from); - SAFE_FREE(orig_to); - - if (!last_from || !last_to) { - SAFE_FREE(last_from); - SAFE_FREE(last_to); + if (win_driver == NULL || os2_driver == NULL) { + SAFE_FREE(win_driver); + SAFE_FREE(os2_driver); return false; } return true; @@ -3902,10 +3899,10 @@ static void map_to_os2_driver(fstring drivername) if (!*mapfile) return; - if (strequal(drivername,get_last_from())) { + if (strequal(drivername, get_win_driver())) { DEBUG(3,("Mapped Windows driver %s to OS/2 driver %s\n", - drivername,get_last_to())); - fstrcpy(drivername,get_last_to()); + drivername, get_os2_driver())); + fstrcpy(drivername, get_os2_driver()); return; } @@ -3954,7 +3951,7 @@ static void map_to_os2_driver(fstring drivername) if (strequal(nt_name,drivername)) { DEBUG(3,("Mapped windows driver %s to os2 driver%s\n",drivername,os2_name)); - set_last_from_to(drivername,os2_name); + set_driver_mapping(drivername,os2_name); fstrcpy(drivername,os2_name); TALLOC_FREE(lines); return; |