On Win32, when splitting file names into directory and last component,

search for '\' rather than '/'.

svn path=/trunk/; revision=1545
This commit is contained in:
Guy Harris 2000-01-25 00:17:01 +00:00
parent de51ae65a6
commit 59fcaf5c03
2 changed files with 12 additions and 5 deletions

8
file.c
View File

@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
* $Id: file.c,v 1.155 2000/01/24 19:32:13 guy Exp $
* $Id: file.c,v 1.156 2000/01/25 00:17:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -245,7 +245,7 @@ set_display_filename(capture_file *cf)
if (!cf->is_tempfile) {
/* Get the last component of the file name, and put that in the
status bar. */
if ((name_ptr = (gchar *) strrchr(cf->filename, '/')) == NULL)
if ((name_ptr = (gchar *) strrchr(cf->filename, PATH_SEPARATOR)) == NULL)
name_ptr = cf->filename;
else
name_ptr++;
@ -279,7 +279,7 @@ read_cap_file(capture_file *cf)
char errmsg_errno[1024+1];
gchar err_str[2048+1];
if ((name_ptr = (gchar *) strrchr(cf->filename, '/')) == NULL)
if ((name_ptr = (gchar *) strrchr(cf->filename, PATH_SEPARATOR)) == NULL)
name_ptr = cf->filename;
else
name_ptr++;
@ -1320,7 +1320,7 @@ save_cap_file(char *fname, capture_file *cf, gboolean save_filtered,
struct wtap_pkthdr hdr;
guint8 pd[65536];
if ((name_ptr = (gchar *) strrchr(fname, '/')) == NULL)
if ((name_ptr = (gchar *) strrchr(fname, PATH_SEPARATOR)) == NULL)
name_ptr = fname;
else
name_ptr++;

View File

@ -1,7 +1,7 @@
/* globals.h
* Global defines, etc.
*
* $Id: globals.h,v 1.15 2000/01/24 04:44:35 guy Exp $
* $Id: globals.h,v 1.16 2000/01/25 00:17:01 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -74,6 +74,13 @@
# define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
/* Pathname separator. */
#ifdef WIN32
#define PATH_SEPARATOR '\\'
#else
#define PATH_SEPARATOR '/'
#endif
extern FILE *data_out_file;
extern packet_info pi;
extern capture_file cf;