-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bug 811 as follows
<quote>
rc/af/xap/unix/xap_UnixDlg_FileOpenSaveAs.cpp uses obsolete "rindex()" in
three places.  It should be recoded to use the equivalent ANSI "strrchr()"
function. If needed for some broken platform out there, you could have
your configuration utility do something like this:

#ifdef NEED_STRRCHR
#define strrchr rindex
#endif
</quote>

rindex() is a BSD 4.3 function, implemented on (at least my ) Linux
systems.  srrrchr() is a POSIX, BSD 4.3, SVID3, ISO 9899 function.
Therefore, there should be no platforms that support rindex() that do not
support strrchr().  

The attached patch makes the changes.  

           
                                sam th               
                                [EMAIL PROTECTED]
                                http://bur-jud-118-039.rh.uchicago.edu                 
                 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE48j9Lt+kM0Mq9M/wRAiCxAKDb8Y1F8/sDhlCA3a5Oa4uh4NacjACeLAeu
ws3kKlqIRZODojMca/B+hhk=
=Kmz7
-----END PGP SIGNATURE-----
Index: src/af/xap/unix/xap_UnixDlg_FileOpenSaveAs.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/unix/xap_UnixDlg_FileOpenSaveAs.cpp,v
retrieving revision 1.34
diff -u -r1.34 xap_UnixDlg_FileOpenSaveAs.cpp
--- src/af/xap/unix/xap_UnixDlg_FileOpenSaveAs.cpp      2000/01/29 01:07:13     1.34
+++ src/af/xap/unix/xap_UnixDlg_FileOpenSaveAs.cpp      2000/04/10 20:48:40
@@ -277,7 +277,7 @@
                // for a matching directory.  We can then proceed with the file
                // if another stat of that dir passes.
 
-               pLastSlash = rindex(szFinalPathnameCopy,'/');
+               pLastSlash = strrchr(szFinalPathnameCopy,'/');
                if (!pLastSlash)
                {
                        _notifyError_OKOnly(pFrame,XAP_STRING_ID_DLG_InvalidPathname);
@@ -580,7 +580,7 @@
                        // the dialog there (but without a filename).
 
                        UT_cloneString(szPersistDirectory,m_szPersistPathname);
-                       char * pLastSlash = rindex(szPersistDirectory, '/');
+                       char * pLastSlash = strrchr(szPersistDirectory, '/');
                        if (pLastSlash)
                                pLastSlash[1] = 0;
                        gtk_file_selection_set_filename(pFS,szPersistDirectory);
@@ -611,7 +611,7 @@
                        // use directory(m_szInitialPathname)
                        
                        UT_cloneString(szPersistDirectory,m_szInitialPathname);
-                       char * pLastSlash = rindex(szPersistDirectory, '/');
+                       char * pLastSlash = strrchr(szPersistDirectory, '/');
                        if (pLastSlash)
                                pLastSlash[1] = 0;
                        gtk_file_selection_set_filename(pFS,szPersistDirectory);

Reply via email to