Skip to content

Commit

Permalink
quote.h: simplify the inclusion
Browse files Browse the repository at this point in the history
Attempting to include quote.h without first including strbuf.h results
in warnings:

 ./quote.h:33:33: warning: ‘struct strbuf’ declared inside parameter list
 ./quote.h:33:33: warning: its scope is only this definition or declaration, which is probably not what you want
 ./quote.h:34:34: warning: ‘struct strbuf’ declared inside parameter list
 ...

Add a toplevel declaration for struct strbuf to avoid this.

While at it, stop including system headers from quote.h.  git source
files already need to include git-compat-util.h sooner to ensure the
appropriate feature test macros are defined.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Feb 7, 2011
1 parent c4d9986 commit cf548ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions quote.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef QUOTE_H
#define QUOTE_H

#include <stddef.h>
#include <stdio.h>
struct strbuf;

/* Help to copy the thing properly quoted for the shell safety.
* any single quote is replaced with '\'', any exclamation point
Expand Down

0 comments on commit cf548ca

Please sign in to comment.