[asterisk-dev] [svn-commits] mmichelson: trunk r71914 - /trunk/apps/app_record.c

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Jun 27 10:56:16 CDT 2007


On Wednesday 27 June 2007 07:57, Russell Bryant wrote:
> SVN commits to the Digium repositories wrote:
> > +	/* Create the directory if it does not exist. */
> > +	dir = ast_strdupa(tmp);
> > +	if ((file = strrchr(dir, '/')))
> > +		*file++ = '\0';
>
> The previous two lines can be simplified by using:
>
> dir = strsep(&dir, "/");
>
> Then, you don't need the file var at all.

That would be true if the function call was strchr(), but it's not,
it's strrchr().  strsep() would not do the same thing.

-- 
Tilghman



More information about the asterisk-dev mailing list